33 lines
859 B
Dart
33 lines
859 B
Dart
class AppException implements Exception {
|
|
final _message;
|
|
final _prefix;
|
|
|
|
AppException([this._message, this._prefix]);
|
|
|
|
String toString() {
|
|
return "$_prefix$_message";
|
|
}
|
|
}
|
|
|
|
class FetchDataException extends AppException {
|
|
FetchDataException([String? message])
|
|
: super(message, 'Fehler bei der Kommunikation: ');
|
|
}
|
|
|
|
class BadRequestException extends AppException {
|
|
BadRequestException([message]) : super(message, 'Ungültige Anfrage; ');
|
|
}
|
|
|
|
class UnauthorizedException extends AppException {
|
|
UnauthorizedException([message])
|
|
: super(message, 'Nicht authorisierte Anfrage; ');
|
|
}
|
|
|
|
class InvalidInputException extends AppException {
|
|
InvalidInputException([message]) : super(message, 'Ungültige Eingabe; ');
|
|
}
|
|
|
|
class InternalException extends AppException {
|
|
InternalException([message]) : super(message, 'Interner Fehler; ');
|
|
}
|