Override the 'toString' method to provide a custom string representation of the exception.
@override String toString() { return "$message${details == null ? '' : " $details"}"; }