Readable error for HTTP423

This commit is contained in:
Ming Ming 2021-04-10 14:34:19 +08:00
parent e9c22a8415
commit 9fe2c41269
2 changed files with 6 additions and 0 deletions

View file

@ -11,6 +11,8 @@ String toUserString(dynamic exception, BuildContext context) {
if (exception is ApiException) {
if (exception.response.statusCode == 401) {
return AppLocalizations.of(context).errorUnauthenticated;
} else if (exception.response.statusCode == 423) {
return AppLocalizations.of(context).errorLocked;
}
} else if (exception is SocketException) {
return AppLocalizations.of(context).errorDisconnected;

View file

@ -347,5 +347,9 @@
"errorDisconnected": "Unable to connect. Server may be offline or your device may be disconnected",
"@errorDisconnected": {
"description": "Error message when the app can't connect to the server"
},
"errorLocked": "File is locked on server. Please try again later",
"@errorLocked": {
"description": "Error message when server responds with HTTP423"
}
}