-
-
Notifications
You must be signed in to change notification settings - Fork 71
Closed
Labels
type:featureNew feature or improvement of existing featureNew feature or improvement of existing feature
Description
New Feature / Enhancement Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
Current Limitation
Currently it's not really easy to know how to compare errors. It would be nice if there is some example in the Playground.
Feature / Enhancement Description
It will be used as an extension.
Example Use Case
if error.containedInParseError([.objectNotFound, .invalidQuery]) {
assertionFailure("The query is invalid or the object is not found.")
}
Alternatives / Workarounds
guard let parseError = error as? ParseError else {
//Do stuff for different error
return
}
switch parseError.code {
case .objectNotFound:
// Handle object not found
default:
// There was a different issue that we don't know how to handle
}
Metadata
Metadata
Assignees
Labels
type:featureNew feature or improvement of existing featureNew feature or improvement of existing feature