actions-test/lib/backend/errors.dart
Jakob Meier c54e4f519f
Added about room screen.
NOTE: Some of the route redirect options are still missing.
There should also be a delete Room option
2023-03-22 21:17:03 +01:00

30 lines
737 B
Dart

/*
* Tool to automatically generate english text from error
*/
String errorAsString(Map<String, dynamic> json) {
switch (json['data']) {
case 'notfound':
return 'Endpoint not found';
case 'wrongstate':
return 'Missing data';
case 'data':
return 'Invalid data';
case 'roomAdmin':
case 'right':
return 'You are not allowed to perform this action';
case 'server':
return 'Server error';
case 'closed':
return 'Server cannot be reached';
case 'auth':
return 'Username or password wrong';
case 'ota':
return 'Invalid OTA';
case 'existence':
return 'Username unavailable';
case 'config':
return 'Server reached user limit';
}
return "Unknown Error";
}