Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Conversation

@FredericRuaudel
Copy link
Contributor

This MR adds a feature that allows Curly clients to analyse errors thrown by the service with more precision.

  • It exposes the CURLResponse.Error publicly (as in the original Perfect version)
  • It exposes a CurlyError type alias of CURLResponse.Error for shorter syntax
  • It adds a CurlyError.Code enum that maps the internal CURLcode enum from libCurl
  • It adds tests to verify the Error is correctly exposed as public and each CURLCode is correctly mapped

Needed to be able to manage CurlyClient's error precisely
and convert the CurlyError.code property from Int to Code
Add a test to check that any new error code introduced by libCurl will be catched in a failed test
@vzsg
Copy link
Owner

vzsg commented Jun 11, 2019

Sweet, thank you! I'll merge it in and tag a new version soon.

# Conflicts:
#	Tests/CurlyClientTests/CurlyClientTests.swift
@vzsg vzsg merged commit 2a37202 into vzsg:master Jun 11, 2019
vzsg added a commit that referenced this pull request Jun 11, 2019
There was a side-effect in PR #1 that I noticed after merging: CURLResponse at this point in time should not be public, as none of its functionality is exposed (especially not for successful requests). To undo the leak, I moved the error into a separate, public struct with a public enum and hid CURLResponse again.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants