New Issue Checklist
Issue Description
The current SDK returns all errors with ParseError which can not be used to determine the exact error details to show on the UI.
Steps to reproduce
- Disconnect the internet on your device (Turn on Airplane Mode)
- Try to call any CloudCode function
Actual Outcome
You will get this ParseError:
(lldb) po error
ParseError code=-1 error=Unable to connect with parse-server: Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x282733570 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_NSURLErrorNWPathKey=unsatisfied (No network route), _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <27703A59-4B71-4320-B775-0560BC43DFDB>.<6>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <27703A59-4B71-4320-B775-0560BC43DFDB>.<6>"
), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=https://host/functions/FunctionName, NSErrorFailingURLKey=https://host/functions/FunctionName, _kCFStreamErrorDomainKey=1}
- code : ParseSwift.ParseError.Code.unknownError
- message : "Unable to connect with parse-server: Error Domain=NSURLErrorDomain Code=-1009 \"The Internet connection appears to be offline.\" UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x282733570 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 \"(null)\" UserInfo={_NSURLErrorNWPathKey=unsatisfied (No network route), _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <27703A59-4B71-4320-B775-0560BC43DFDB>.<6>, _NSURLErrorRelatedURLSessionTaskErrorKey=(\n \"LocalDataTask <27703A59-4B71-4320-B775-0560BC43DFDB>.<6>\"\n), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=https://host/functions/FunctionName, NSErrorFailingURLKey=https://host/functions/FunctionName, _kCFStreamErrorDomainKey=1}"
- otherCode : nil
You'll get these details:
(lldb) po error.domain
"ParseSwift.ParseError"
(lldb) po error.code
1
(lldb) po error.localizedDescription
"ParseError code=-1 error=Unable to connect with parse-server: Error Domain=NSURLErrorDomain Code=-1009 \"The Internet connection appears to be offline.\" UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x282733570 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 \"(null)\" UserInfo={_NSURLErrorNWPathKey=unsatisfied (No network route), _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <27703A59-4B71-4320-B775-0560BC43DFDB>.<6>, _NSURLErrorRelatedURLSessionTaskErrorKey=(\n \"LocalDataTask <27703A59-4B71-4320-B775-0560BC43DFDB>.<6>\"\n), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey= host/functions/FunctionName, NSErrorFailingURLKey=https://host/functions/FunctionName, _kCFStreamErrorDomainKey=1}"
We can not get the exact error domain NSURLErrorDomain, code -1009 with the message The Internet connection appears to be offline to display it on the UI correctly, but only ParseSwift.ParseError code 1 all the time.
Expected Outcome
We need an originalError variable in ParseError so we can check what was the exact error that caused the problem, not just ParseSwift.ParseError code 1
Environment
Client
- Parse Swift SDK version:
4.14.2
- Xcode version:
14.2
- Operating system (iOS, macOS, watchOS, etc.):
iOS 16.3
- Operating system version:
MacOS
Server
- Parse Server version:
4.5.0
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
AWS
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
3.6
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
AWS
Logs
(lldb) po error
ParseError code=-1 error=Unable to connect with parse-server: Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x282733570 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_NSURLErrorNWPathKey=unsatisfied (No network route), _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <27703A59-4B71-4320-B775-0560BC43DFDB>.<6>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <27703A59-4B71-4320-B775-0560BC43DFDB>.<6>"
), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=https://host/functions/FunctionName, NSErrorFailingURLKey=https://host/functions/FunctionName, _kCFStreamErrorDomainKey=1}
- code : ParseSwift.ParseError.Code.unknownError
- message : "Unable to connect with parse-server: Error Domain=NSURLErrorDomain Code=-1009 \"The Internet connection appears to be offline.\" UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x282733570 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 \"(null)\" UserInfo={_NSURLErrorNWPathKey=unsatisfied (No network route), _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <27703A59-4B71-4320-B775-0560BC43DFDB>.<6>, _NSURLErrorRelatedURLSessionTaskErrorKey=(\n \"LocalDataTask <27703A59-4B71-4320-B775-0560BC43DFDB>.<6>\"\n), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=https://host/functions/FunctionName, NSErrorFailingURLKey=https://host/functions/FunctionName, _kCFStreamErrorDomainKey=1}"
- otherCode : nil
(lldb) po error.domain
"ParseSwift.ParseError"
(lldb) po error.code
1
(lldb) po error.localizedDescription
"ParseError code=-1 error=Unable to connect with parse-server: Error Domain=NSURLErrorDomain Code=-1009 \"The Internet connection appears to be offline.\" UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x282733570 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 \"(null)\" UserInfo={_NSURLErrorNWPathKey=unsatisfied (No network route), _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <27703A59-4B71-4320-B775-0560BC43DFDB>.<6>, _NSURLErrorRelatedURLSessionTaskErrorKey=(\n \"LocalDataTask <27703A59-4B71-4320-B775-0560BC43DFDB>.<6>\"\n), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey= host/functions/FunctionName, NSErrorFailingURLKey=https://host/functions/FunctionName, _kCFStreamErrorDomainKey=1}"
New Issue Checklist
Issue Description
The current SDK returns all errors with ParseError which can not be used to determine the exact error details to show on the UI.
Steps to reproduce
Actual Outcome
You will get this ParseError:
You'll get these details:
We can not get the exact error domain
NSURLErrorDomain, code-1009with the messageThe Internet connection appears to be offlineto display it on the UI correctly, but onlyParseSwift.ParseErrorcode 1all the time.Expected Outcome
We need an
originalErrorvariable inParseErrorso we can check what was the exact error that caused the problem, not justParseSwift.ParseError code 1Environment
Client
4.14.214.2iOS 16.3MacOSServer
4.5.0AWSDatabase
MongoDB3.6AWSLogs