Skip to content

Commit 28c9819

Browse files
authored
feat(postgrest): Add toJson() method to PostgrestException to allow serialization (supabase#783)
feat(postgrest): toJson method to allow serialization
1 parent 0585ee9 commit 28c9819

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/postgrest/lib/src/types.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ class PostgrestException implements Exception {
3333
);
3434
}
3535

36+
Map<String, dynamic> toJson() {
37+
return {
38+
'message': message,
39+
'code': code,
40+
'details': details,
41+
'hint': hint,
42+
};
43+
}
44+
3645
@override
3746
String toString() {
3847
return 'PostgrestException(message: $message, code: $code, details: $details, hint: $hint)';

0 commit comments

Comments
 (0)