Skip to content

Commit

Permalink
Add exception
Browse files Browse the repository at this point in the history
  • Loading branch information
HamiiidAsgarian committed Sep 21, 2024
1 parent 4ddaab4 commit ca881f7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/core/errors/exceptions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
sealed class AppException implements Exception {
AppException({
this.id,
this.error,
this.additionalData = '',
this.isLogged = false,
this.stackTrace,
});
final String? id;
final String? error;
final String additionalData;
final bool isLogged;
final StackTrace? stackTrace;
}

//----
class JsonParseException extends AppException {
JsonParseException({
required super.error,
this.body,
}) : super(
additionalData: 'recieved body: $body',
);

String? body;
}

0 comments on commit ca881f7

Please sign in to comment.