From 36aa7ea64e9de44688edbad2d057370f580d0d78 Mon Sep 17 00:00:00 2001 From: Ricardo Boss Date: Thu, 6 Jun 2024 01:20:57 +0200 Subject: [PATCH] Added a toString override to SeqClientException --- lib/src/seq_client_exception.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/src/seq_client_exception.dart b/lib/src/seq_client_exception.dart index 026a3a0..536878b 100644 --- a/lib/src/seq_client_exception.dart +++ b/lib/src/seq_client_exception.dart @@ -14,4 +14,19 @@ class SeqClientException implements Exception { /// The stack trace of the exception that caused this exception, if any. final StackTrace? innerStackTrace; + + @override + String toString() { + final buffer = StringBuffer() + ..write('SeqClientException: ') + ..write(message); + + if (innerException != null) { + buffer + ..write('; innerException: ') + ..write(innerException); + } + + return buffer.toString(); + } }