2021-02-02 14:33:23 +00:00
|
|
|
import '../enums/error_code.dart';
|
|
|
|
|
|
|
|
class ServiceException implements Exception {
|
|
|
|
final ErrorCode code;
|
2021-11-29 23:44:22 +00:00
|
|
|
final String? message;
|
2021-02-02 14:33:23 +00:00
|
|
|
|
2023-01-04 20:17:54 +00:00
|
|
|
ServiceException({this.code = ErrorCode.generalError, this.message = ''});
|
2021-02-02 14:33:23 +00:00
|
|
|
|
2023-01-04 20:17:54 +00:00
|
|
|
@override
|
2021-02-02 14:33:23 +00:00
|
|
|
String toString() {
|
|
|
|
return "$code: $message";
|
|
|
|
}
|
|
|
|
}
|