Skip to content

Commit

Permalink
feat(postgrest): Add toJson() method to PostgrestException to all…
Browse files Browse the repository at this point in the history
…ow serialization (#783)

feat(postgrest): toJson method to allow serialization
  • Loading branch information
borgoat committed Jan 3, 2024
1 parent 0585ee9 commit 28c9819
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/postgrest/lib/src/types.dart
Expand Up @@ -33,6 +33,15 @@ class PostgrestException implements Exception {
);
}

Map<String, dynamic> toJson() {
return {
'message': message,
'code': code,
'details': details,
'hint': hint,
};
}

@override
String toString() {
return 'PostgrestException(message: $message, code: $code, details: $details, hint: $hint)';
Expand Down

0 comments on commit 28c9819

Please sign in to comment.