Skip to content

Commit

Permalink
Merge pull request #228 from WildernessLabs/feature/system-error
Browse files Browse the repository at this point in the history
added ToString for SystemErrorInfo
  • Loading branch information
adrianstevens committed May 15, 2024
2 parents 81e6c46 + 5f38588 commit 4478cf8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Source/Meadow.Contracts/Exceptions/MeadowSystemErrorInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,16 @@ public enum SystemErrorNumber
ErrorNumber = systemErrorNumber;
Exception = exception;
}

/// <inheritdoc/>
public override string ToString()
{
var s = $"{this.GetType().Name} ({ErrorNumber}): {Message}";
if (Exception != null)
{
s += $"{Environment.NewLine}Inner: {Exception.GetType().Name}: {Exception.Message}";
}

return s;
}
}

0 comments on commit 4478cf8

Please sign in to comment.