-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
- Loading branch information
1 parent
73afa28
commit 3aa993c
Showing
52 changed files
with
1,030 additions
and
358 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
Speckle.Sdk.Testing/Framework/AggregationExceptionScrubber.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Speckle.Sdk.Common; | ||
|
||
namespace Speckle.Sdk.Testing.Framework; | ||
|
||
public class AggregationExceptionScrubber : WriteOnlyJsonConverter<AggregateException> | ||
{ | ||
private static readonly ExceptionScrubber _innerScrubber = new(); | ||
|
||
public override void Write(VerifyJsonWriter writer, AggregateException exception) | ||
{ | ||
writer.WriteStartObject(); | ||
|
||
writer.WriteMember(exception, exception.GetType().FullName, "Type"); | ||
if (exception.InnerExceptions.Count == 1) | ||
{ | ||
writer.WritePropertyName("InnerException"); | ||
_innerScrubber.Write(writer, exception.InnerException.NotNull()); | ||
} | ||
else | ||
{ | ||
writer.WritePropertyName("InnerExceptions"); | ||
writer.WriteStartArray(); | ||
foreach (var innerException in exception.InnerExceptions) | ||
{ | ||
_innerScrubber.Write(writer, innerException); | ||
} | ||
writer.WriteEndArray(); | ||
} | ||
|
||
writer.WriteEndObject(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 68 additions & 8 deletions
76
src/Speckle.Sdk.Dependencies/Serialization/ChannelLoader.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.