NSError
Undocumented
-
Convenience creator for a
JSONResponseErrorDomainerror with codeJSONResponseUnexpectedTypeCode. Description and failure reason can be set through the optional parameters.Declaration
Swift
public static func unexpectedTypeErrorForJSON(json:JSON, expectedType:Type, localizedDescription: String = "Unable to create object.", localizedFailureReason: String = "Unexpected JSON format. Expected '%@', got '%@'") -> NSErrorParameters
jsonThe
JSONobject of the unexpected type.expectedTypeThe
JSON.Typethat was expected.localizedDescriptionThe
localizedDescriptionfor the error being created. Default value isUnable to create object.
.localizedFailureReasonThe
localizedFailureReasonfor the error being created. Default value isUnexpected JSON format. Expected ’%@’, got ’%@’
, where the two arguments are theexpectedTypeand actual type ofjson. -
Convenience creator for a
JSONResponseErrorDomainerror with codeJSONResponseMissingElementCode. Description and failure reason can be set through the optional parameters.Declaration
Swift
public static func missingElementErrorForJSON(json:JSON, localizedDescription: String = "Unable to create object.", localizedFailureReason: String = "Missing required elements.") -> NSErrorParameters
jsonThe
JSONobject of the unexpected type.localizedDescriptionThe
localizedDescriptionfor the error being created. Default value isUnable to create object.
.localizedFailureReasonThe
localizedFailureReasonfor the error being created. Default value isMissing required elements.
.
View on GitHub
NSError Extension Reference