Add a SpacetimeDBException to C# SDK to aid in debugging #3386
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
This implements a fix to an issue with debugging using the C# SDK, by adding new exception types:
SpacetimeDBException
,SpacetimeDBArgumentException
,SpacetimeDBEmptyReducerNameException
Additional, regenerating bindings will now allow clients to report an
SpacetimeDBEmptyReducerNameException
rather than anArgumentOutOfRangeException
when the client receives an empty reducer name from the server.An example of the generated code currently, that results in the exception:
SpacetimeDB/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs
Line 475 in 544e2ed
Note: Normally this is not an issue for a client, because the
SpacetimeDBEmptyReducerNameException
would be caught by the Try/Catch statement, but a debugger will still catch the exception and halt operation. This can be annoying to a developer when debugging.By separating out the exception into a custom
Exception
type, we allow a developer to flag the new exception type as something it can ignore, without ignoring other relevant exceptions.API and ABI breaking changes
Not a breaking change.
Clients will need to regenerate bindings to get the new exceptions
Expected complexity level and risk
1
Testing
SpacetimeDBEmptyReducerNameException
when expected.