Skip to content

Commit fee225c

Browse files
committed
Better error on non-JSON write checkpoint errors.
1 parent 5aa9919 commit fee225c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/powersync_core/lib/src/exceptions.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ class SyncResponseException implements Exception {
5858
final details = _stringOrFirst(decoded['error']?['details']) ?? body;
5959
final message = '${response.reasonPhrase ?? "Request failed"}: $details';
6060
return SyncResponseException(response.statusCode, message);
61+
} on FormatException catch (_) {
62+
return SyncResponseException(
63+
response.statusCode,
64+
response.reasonPhrase ?? "Request failed",
65+
);
6166
} on Error catch (_) {
6267
return SyncResponseException(
6368
response.statusCode,

0 commit comments

Comments
 (0)