-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implementation of URLSessionTask '.error', NSCopying #713
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
Conversation
@pushkarnk can you review, please? |
@@ -221,7 +221,7 @@ open class URLSessionTask : NSObject, NSCopying { | |||
* The error, if any, delivered via -URLSession:task:didCompleteWithError: | |||
* This property will be nil in the event that no error occured. | |||
*/ | |||
/*@NSCopying*/ open var error: NSError? { NSUnimplemented() } | |||
/*@NSCopying*/ open fileprivate(set) var error: NSError? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that we can keep this fileprivate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows to set error
without creating a backing private property.
The other option is to create fileprivate var _error: Error?
and make error
a get only computed property.
…NSError with Error to conform to macOS Foundation
@pushkarnk updated. Also switched |
Thank you @naithar ! Looks good to me. |
@swift-ci please test and merge |
@swift-ci please test |
1 similar comment
@swift-ci please test |
There was a segfault:
|
We see the same segfault in #719 again in the newly added test case. 🤔 |
Tested on local environment, no segmentation fault atm. #712 Also failed, though for the other reason. |
Yeah, may be @parkera can help us here! |
A change elsewhere in the stack maybe? I'll try another test and we'll go from there... |
@swift-ci please test |
same failure again |
@swift-ci please test |
Trying again. |
@swift-ci please test |
Any updates? |
@swift-ci please test |
@naithar May I ask if your local environment is based on Ubuntu 16.04? |
@pushkarnk no, i used 15.10 last time for tests. I'll try running on 16.04 tomorrow as it's already used for some internal swift projects. |
This PR does indeed crash on Ubuntu 16.04. I'll try to work this out. |
Test crashes on accessing |
@pushkarnk with this changes tests should be running correctly. I'll also look into #719 to see if it's somehow connected with my error. |
@swift-ci please test |
1 similar comment
@swift-ci please test |
Thanks @naithar ! |
Added an implementation for
.error
property andNSCopying
forURLSessionTask
Added tests.
.cancel()
is implemented in: #689