Back

Error type for Apple AppwriteError

  • 0
  • Accounts
  • Apple
13thApostle
9 Sep, 2023, 14:04

This question concerns Apple platform Hello,

I don't get how to localize errors returned from AppWrite. The only things present in AppwriteError instance are code and message. The "type" is always nil.

So, if I am not mistaken the only way to provide users with accurate error description is to localize errors based on the "message" property..?

If so, then we will get something like

//... switch error.message { case "Invalid email : please provide valid email": return "something localized" case ...// }

If so, this is not okay. I still hope though that this could be done easily and I did not get how to do that because I am new to AppWrite

Thanks for your help

TL;DR
The user is experiencing an issue with localizing errors returned from AppWrite on the Apple platform. The "type" property in the AppWriteError instance is always nil. They are wondering if the only way to provide users with accurate error descriptions is to localize errors based on the "message" property. They are hoping for an easier solution and assistance.
Drake
9 Sep, 2023, 17:20

uhhhhhhhhhh that's weird... type shouldn't be null. Are you catching an AppwriteException? What's your code?

Drake
9 Sep, 2023, 17:21

oh shoot...can you create an issue on github? it does look like we're not extracting the type from the response 😬

13thApostle
10 Sep, 2023, 10:31

Ok, I im glad there will be the way to work with errors properly!)

I am going to create an issue, but will it be ok if I just copypast the text from here?

Thank you!

13thApostle
10 Sep, 2023, 10:37

Done!

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more