Skip to content

Instantly share code, notes, and snippets.

@xsahil03x
Created July 2, 2019 20:54
Show Gist options
  • Save xsahil03x/19d07da1bc5a082234842488872cc983 to your computer and use it in GitHub Desktop.
Save xsahil03x/19d07da1bc5a082234842488872cc983 to your computer and use it in GitHub Desktop.
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, "Error During Communication: ");
}
class BadRequestException extends AppException {
BadRequestException([message]) : super(message, "Invalid Request: ");
}
class UnauthorisedException extends AppException {
UnauthorisedException([message]) : super(message, "Unauthorised: ");
}
class InvalidInputException extends AppException {
InvalidInputException([String message]) : super(message, "Invalid Input: ");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment