SyncServerII / Neebla

Private and Self-Owned Social Media
MIT License
1 stars 2 forks source link

Errors displayed to the user #13

Open crspybits opened 3 years ago

crspybits commented 3 years ago

I’ve now taken out “There was a server error.” so that’s no longer displayed to the user. It could be good, however, to map some of the internal errors to human readable errors and display them to the user. The iOSShared library has the UserDisplayable protocol which could be used. E.g., in Neebla I’m doing: if let error = error as? UserDisplayable, let message = error.userDisplayableMessage { showAlert(AlertyHelper.alert(title: message.title, message: message.message)) }

This needs to be used cautiously though. There's not a whole lot of point in showing a user errors that they are not actionable. However if something like a sync fails due to a network error that could be useful to show the user. i.e., so they can refresh again later.