Override `toString()` in `DriftRemoteException`

This commit is contained in:
Simon Binder 2022-03-14 15:35:35 +01:00
parent c6edcdf3e8
commit b0ab9ba777
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
2 changed files with 4 additions and 0 deletions

View File

@ -202,4 +202,7 @@ class DriftRemoteException implements Exception {
final StackTrace? remoteStackTrace;
DriftRemoteException._(this.remoteCause, this.remoteStackTrace);
@override
String toString() => remoteCause.toString();
}

View File

@ -85,6 +85,7 @@ void main() {
fail('Should have thrown an exception');
} catch (e, s) {
expect(e, isA<DriftRemoteException>());
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.