mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #291] error.code is inaccessible due to 'fileprivate' protection level #173
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#173
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dbmrq on GitHub (Oct 11, 2016).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/291
When a request failed, I used to be able to check the error code, like this:
Now with Swift 3 I can't do that anymore, I get that error: "'code' is inaccessible due to 'fileprivate' protection level".
@phimage commented on GitHub (Oct 11, 2016):
see OAuthSwiftError
it could be an
.tokenExpiredor.requestErrorfor code 401 (with last code, not released yet you have attributeunderlyingError)you can do a if
or a switch
then you can cast to
NSErroror there is in swift_code@dbmrq commented on GitHub (Oct 11, 2016):
Ah, awesome, thanks!
@dbmrq commented on GitHub (Nov 22, 2016):
@phimage So I was doing what you described in your last answer here, but now I updated to the latest version and I get "Enum case 'tokenExpired' not found in type 'Error'". Any ideas?
PS: You should consider adding a change log. It would be a huge help figuring out this sort of stuff.
Edit: Ah, I just had to specify
OAuthSwiftError.tokenExpired. Never mind. :)@phimage commented on GitHub (Nov 22, 2016):
please refer to release for change log
then swift 3 has been a big big change, you cannot write every modifications