Skip to content

Commit

Permalink
Better error on non-JSON write checkpoint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
rkistner committed Jan 6, 2025
1 parent 5aa9919 commit fee225c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/powersync_core/lib/src/exceptions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ class SyncResponseException implements Exception {
final details = _stringOrFirst(decoded['error']?['details']) ?? body;
final message = '${response.reasonPhrase ?? "Request failed"}: $details';
return SyncResponseException(response.statusCode, message);
} on FormatException catch (_) {
return SyncResponseException(
response.statusCode,
response.reasonPhrase ?? "Request failed",
);
} on Error catch (_) {
return SyncResponseException(
response.statusCode,
Expand Down

0 comments on commit fee225c

Please sign in to comment.