SkygearIO / skygear-SDK-iOS

Skygear SDK for iOS
https://skygear.io
Other
10 stars 28 forks source link

Confusing error message when asset being uploaded is nil #22

Open HenryHins opened 8 years ago

HenryHins commented 8 years ago

Swift code:

let asset = SKYAsset(name: "profile-picture", data: UIImagePNGRepresentation(UIImage()))
asset.mimeType = "image/png"

Error message:

Error Domain=SKYOperationErrorDomain Code=9 "The data sent by the server cannot be processed." UserInfo={SKYErrorName=InvalidData, NSLocalizedDescription=The data sent by the server cannot be processed., SKYErrorMessage=Uploaded asset does not have a name associated with it.}