2352306269
* 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
25 lines
576 B
C#
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());
|
|
}
|
|
}
|