feat: add arch
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
class AppException implements Exception {
|
||||
final String message;
|
||||
final String prefix;
|
||||
|
||||
AppException([this.message = 'An unknown error occurred.', this.prefix = '']);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return '$prefix$message';
|
||||
}
|
||||
}
|
||||
|
||||
class FetchDataException extends AppException {
|
||||
FetchDataException([String? message])
|
||||
: super(message ?? 'Error During Communication: ', 'Network Error');
|
||||
}
|
||||
|
||||
class AuthenticationException extends AppException {
|
||||
AuthenticationException([String? message])
|
||||
: super(message ?? 'Authentication Failed.', 'Auth Error');
|
||||
}
|
||||
Reference in New Issue
Block a user