Fixed exceptions in C# SDK when someone disconnects or when a transaction originates from CLI

This commit is contained in:
Steve Boytsun
2024-06-26 12:25:03 -04:00
parent 8be8fc1248
commit 9ff2f62fc7
2 changed files with 4 additions and 0 deletions
@@ -712,6 +712,8 @@ pub fn autogen_csharp_globals(items: &[GenItem], namespace: &str) -> Vec<(String
);
}
writeln!(output, "\"<none>\" => null,");
writeln!(output, "\"__identity_disconnected__\" => null,");
writeln!(output, "\"\" => null,"); //Transaction from CLI command
writeln!(
output,
r#"var reducer => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {{reducer}}")"#
@@ -738,6 +738,8 @@ namespace SpacetimeDB
"repeating_test" => BSATNHelpers.FromProtoBytes<RepeatingTestArgsStruct>(argBytes),
"test" => BSATNHelpers.FromProtoBytes<TestArgsStruct>(argBytes),
"<none>" => null,
"__identity_disconnected__" => null,
"" => null,
var reducer => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {reducer}")
};
return new ReducerEvent(dbEvent, args);