Rumahjo-Android-APP/lib/data/helper/custom_exception.dart

35 lines
910 B
Dart
Raw Permalink Normal View History

2024-09-07 00:58:50 +00:00
class CustomException implements Exception {
final dynamic _message;
// ignore: unused_field
final dynamic _prefix;
CustomException([this._message, this._prefix]);
@override
String toString() {
return "$_message";
}
}
class FetchDataException extends CustomException {
FetchDataException([message])
: super(message, "Error During Communication: ");
}
class BadRequestException extends CustomException {
BadRequestException([message]) : super(message, "Invalid Request: ");
}
class UnauthorisedException extends CustomException {
UnauthorisedException([message]) : super(message, "Unauthorised: ");
}
class VerificationException extends CustomException {
VerificationException([message])
: super(message, "Please verify email first ");
}
class InvalidInputException extends CustomException {
InvalidInputException([message]) : super(message, "Invalid Input: ");
}