Created
July 2, 2019 20:54
-
-
Save xsahil03x/19d07da1bc5a082234842488872cc983 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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