diff --git a/drift/lib/src/remote/communication.dart b/drift/lib/src/remote/communication.dart index 71443c91..8e93a319 100644 --- a/drift/lib/src/remote/communication.dart +++ b/drift/lib/src/remote/communication.dart @@ -202,4 +202,7 @@ class DriftRemoteException implements Exception { final StackTrace? remoteStackTrace; DriftRemoteException._(this.remoteCause, this.remoteStackTrace); + + @override + String toString() => remoteCause.toString(); } diff --git a/drift/test/isolate_test.dart b/drift/test/isolate_test.dart index ce944e9c..a3e13a43 100644 --- a/drift/test/isolate_test.dart +++ b/drift/test/isolate_test.dart @@ -85,6 +85,7 @@ void main() { fail('Should have thrown an exception'); } catch (e, s) { expect(e, isA()); + expect(e.toString(), contains('no such table: non_existing_table')); // The stack trace of remote exceptions should point towards the actual // source making the faulty call.