Skip to content

Conversation

rekhoff
Copy link
Contributor

@rekhoff rekhoff commented Oct 8, 2025

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 an ArgumentOutOfRangeException when the client receives an empty reducer name from the server.

An example of the generated code currently, that results in the exception:

var reducer => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {reducer}")

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

  • Tested regenerating bindings and confirmed intended output.
  • Tested debugging and receiving SpacetimeDBEmptyReducerNameException when expected.

@rekhoff rekhoff requested a review from gefjon October 8, 2025 18:57
@rekhoff rekhoff self-assigned this Oct 8, 2025
Copy link
Contributor

github-actions bot commented Oct 8, 2025

Some missing or dangling .meta found. Fix commits are needed.

Status File
Not committed src/Exceptions.cs.meta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant