Files
speckle-sharp-sdk/tests/Speckle.Sdk.Testing/Framework/ExceptionScrubber.cs
T
Adam Hathcock 2352306269 add ability for objectloader to skip server too. (#228)
* add ability for objectloader to skip server too.  add test so both cache and server can't be skipped

* move testing project to correct dir

* remove extra file
2025-02-13 09:41:07 +00:00

25 lines
576 B
C#

using Argon;
namespace Speckle.Sdk.Testing.Framework;
public class ExceptionScrubber : WriteOnlyJsonConverter<Exception>
{
public ExceptionScrubber() { }
public override void Write(VerifyJsonWriter writer, Exception value)
{
if (value.StackTrace != null)
{
var ex = new JObject
{
["Type"] = value.GetType().FullName,
["Message"] = value.Message,
["Source"] = value.Source?.Trim(),
};
writer.WriteRawValue(ex.ToString(Formatting.Indented));
return;
}
base.Write(writer, value.ToString());
}
}