3aa993cecb
* Don't log cancelling * redo exception handling for receive * remove null test case * clean up with Id/Json and more cancels * Change the exception stacks * fix serialization test * make a custom scrubber for internalized exceptions * clean up * fix namespaces again :( * adjust the scrubber * try to make tests more predictable * rework exceptions again * strip out compile files used * formatting * custom exception validation * fix init * Move serialization to own class * save serialize test * add deep clean * add cancellation test on save to cache * cancellation tests * format * do DI correctly * receive cancel works
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());
|
|
}
|
|
}
|