Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make error messages more verbose when debugging #52

Merged
merged 2 commits into from
Dec 20, 2019

Conversation

BalestraPatrick
Copy link
Collaborator

When debugging some issues in my code, I noticed that the associated values of the error cases wouldn't be printed to console, making it harder to figure out what went wrong. Merging this improvement changes the debugDescription in order to better diagnose the associated value of type Data for example:

- requestFailure(401, Optional(350 bytes))
+ Request failed with status code 401 and response {
+	"errors": [{
+		"status": "401",
+		"code": "NOT_AUTHORIZED",
+		"title": "Authentication credentials are missing or invalid.",
+		"detail": "Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens"
+	}]
+ }

@SwiftLeeBot
Copy link
Collaborator

3 Warnings
⚠️ Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the AppStoreConnect-Swift-SDK_Example editor. (in target ‘AppStoreConnect-Swift-SDK_Example’ from project ‘AppStoreConnect-Swift-SDK’)
⚠️ ld: directory not found for option ‘-F/Applications/Xcode-11.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.1.sdk/Developer/Library/Frameworks’
⚠️ Endpoint.swift#L116 - Sources/Endpoint.swift#L116: ‘fileprivate’ modifier is redundant for static property declared in a fileprivate extension
fileprivate static let afURLQueryAllowed: CharacterSet = {
1 Message
📖 Executed 143 tests, with 0 failures (0 unexpected) in 0.700 (2.153) seconds

Powered by xcov

Generated by 🚫 Danger

Copy link
Owner

@AvdLee AvdLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is great! Any debugging improvements are more than welcome :) Thanks for your contribution!

@AvdLee
Copy link
Owner

AvdLee commented Dec 20, 2019

Merging in as CI is currently in an unstable state.

@AvdLee AvdLee merged commit 726d918 into AvdLee:master Dec 20, 2019
@SwiftLeeBot
Copy link
Collaborator

Congratulations! 🎉 This was released as part of Release 1.0.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants