Added more specific error messages
This commit was created in reaction to the new error messages:
606709ae58/src/api/acts/roomContent.ts
(outbag/server@3686c354c8)
This commit is contained in:
parent
a40e3af3e5
commit
661cfe2f2c
2 changed files with 108 additions and 23 deletions
|
@ -5,27 +5,77 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
|||
*/
|
||||
String errorAsString(Map<String, dynamic> json, AppLocalizations trans) {
|
||||
switch (json['data']) {
|
||||
case 'closed':
|
||||
return trans.errorServerClosed;
|
||||
case 'bruteforce':
|
||||
return trans.errorBruteforce;
|
||||
case 'notfound':
|
||||
return trans.errorNotFound;
|
||||
case 'wrongstate':
|
||||
return trans.errorDataIncomplete;
|
||||
return trans.errorInvalidState;
|
||||
case 'data':
|
||||
return trans.errorDataInvalid;
|
||||
case 'roomAdmin':
|
||||
return trans.errorInvalidData;
|
||||
case 'right':
|
||||
return trans.errorPermissions;
|
||||
return trans.errorServerPermissions;
|
||||
case 'server':
|
||||
return trans.errorServer;
|
||||
case 'closed':
|
||||
return trans.errorUnreachable;
|
||||
|
||||
case 'recursion':
|
||||
return trans.errorRemoteRecursion;
|
||||
case 'remote':
|
||||
return trans.errorRemote;
|
||||
|
||||
case 'clientnotexists':
|
||||
return trans.errorAccountDeletion;
|
||||
case 'accountnotexists':
|
||||
return trans.errorNoSuchAccount;
|
||||
case 'accountexists':
|
||||
return trans.errorUsernameTaken;
|
||||
case 'roomexists':
|
||||
return trans.errorRoomIdTaken;
|
||||
case 'roomnotexists':
|
||||
return trans.errorNoSuchRoom;
|
||||
|
||||
case 'membernotexists':
|
||||
return trans.errorNoSuchRoomMember;
|
||||
case 'memberexists':
|
||||
return trans.errorAlreadyInRoom;
|
||||
case 'roomlimit':
|
||||
return trans.errorReachedRoomLimit;
|
||||
case 'roomuserlimit':
|
||||
return trans.errorReachedRoomUserLimit;
|
||||
case 'roomdatalimit':
|
||||
return trans.errorReachedRoomDataLimit;
|
||||
case 'notroomadmin':
|
||||
return trans.errorRoomPermissions;
|
||||
case 'notinroom':
|
||||
return trans.errorNotRoomMember;
|
||||
case 'owner':
|
||||
return trans.errorRoomOwner;
|
||||
|
||||
case 'catnotexists':
|
||||
return trans.errorNoSuchCategory;
|
||||
case 'prodnotexists':
|
||||
return trans.errorNoSuchProduct;
|
||||
case 'itemnotexists':
|
||||
return trans.errorNoSuchItem;
|
||||
case 'addcat':
|
||||
return trans.errorCreatingCategory;
|
||||
case 'addprod':
|
||||
return trans.errorCreatingProduct;
|
||||
case 'additem':
|
||||
return trans.errorCreatingItem;
|
||||
|
||||
case 'config':
|
||||
return trans.errorServerConfig;
|
||||
case 'ota':
|
||||
return trans.errorOTA;
|
||||
case 'auth':
|
||||
return trans.errorAuth;
|
||||
case 'ota':
|
||||
return trans.errorInvalidOTA;
|
||||
case 'existence':
|
||||
return trans.errorUsernameUnavailable;
|
||||
case 'config':
|
||||
return trans.errorServerLimit;
|
||||
case 'signature':
|
||||
return trans.errorInvalidSignature;
|
||||
case 'token':
|
||||
return trans.errorInvalidToken;
|
||||
}
|
||||
|
||||
return trans.errorUnknown;
|
||||
|
|
|
@ -121,16 +121,6 @@
|
|||
"errorUnknown": "Unknown error",
|
||||
"errorServer":"Server error",
|
||||
|
||||
"errorNotFound":"Not found",
|
||||
"errorDataIncomplete":"Missing data",
|
||||
"errorDataInvalid":"Invalid data",
|
||||
"errorPermissions":"You are not allowed to perform this action",
|
||||
"errorUnreachable":"Server cannot be reached",
|
||||
"errorAuth":"Username or password wrong",
|
||||
"errorInvalidOTA":"Invalid OTA",
|
||||
"errorUsernameUnavailable":"A user with that name already exists",
|
||||
"errorServerLimit":"Server reached user limit",
|
||||
|
||||
"themeLight": "Light",
|
||||
"themeDark": "Dark",
|
||||
"themeSystem": "System",
|
||||
|
@ -277,11 +267,56 @@
|
|||
"errorPasswordsDontMatch": "New passwords do not match",
|
||||
"errorOldPasswordWrong": "Your old password is wrong",
|
||||
|
||||
"newCategoryShort": "New",
|
||||
"newCategoryLong": "Create a new category",
|
||||
|
||||
"yes": "Yes",
|
||||
"loading": "Loading",
|
||||
"dismiss": "Dismiss",
|
||||
"cancel": "Cancel",
|
||||
"ok": "OK",
|
||||
"close": "Close",
|
||||
"update": "Update"
|
||||
"update": "Update",
|
||||
|
||||
"errorServerClosed": "Server is offline",
|
||||
"errorBruteforce": "Too many requests",
|
||||
"errorNotFound": "Ressource not found",
|
||||
"errorInvalidState": "Missing data",
|
||||
"errorInvalidData": "Invalid data",
|
||||
"errorServerPermissions": "You are not allowed to perform this action",
|
||||
"errorRemoteRecursion": "Unable to forward request to remote",
|
||||
|
||||
"errorRemote": "Unable to process remote request",
|
||||
|
||||
"errorAccountDeletion": "Your account no longer exists",
|
||||
|
||||
"errorNoSuchAccount": "Account does not exist",
|
||||
"errorUsernameTaken": "Already with that username already exists",
|
||||
"errorNoSuchRoom": "Room does not exist",
|
||||
"errorRoomIdTaken": "Room with that ID already exists",
|
||||
|
||||
"errorNoSuchRoomMember": "There is no Member with that ID",
|
||||
"errorAlreadyInRoom": "The user is already a member of this room",
|
||||
"errorReachedRoomLimit": "You are not allowed to create more rooms",
|
||||
"errorReachedRoomUserLimit": "Cannot join room. User limit exceeded",
|
||||
"errorReachedRoomDataLimit": "Reached room storage limit",
|
||||
"errorNotRoomMember": "You are not a member of this room",
|
||||
"errorRoomOwner": "The room owner (you) is not allowed to perform this action",
|
||||
"errorRoomPermissions": "You are not allowed to perform this action",
|
||||
|
||||
"errorNoSuchCategory": "Category does not exist",
|
||||
"errorNoSuchProduct": "Product does not exist",
|
||||
"errorNoSuchItem": "Item does not exist",
|
||||
"errorCreatingCategory": "Unable to create Category",
|
||||
"errorCreatingProduct": "Unable to create Product",
|
||||
"errorCreatingItem": "Unable to create Item",
|
||||
|
||||
"errorServerConfig": "Cannot join server. User limit exceeded",
|
||||
"errorOTA": "Invalid OTA",
|
||||
"errorAuth": "Username or password wrong",
|
||||
"errorInvalidSignature": "Unable to verify signature",
|
||||
"errorInvalidToken": "Invalid Token",
|
||||
|
||||
"errorServerDoesntExist": "Server does not exist",
|
||||
"errorInvalidServerToken": "Server token invalid"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue