Replies: 3 comments 2 replies
-
|
I will add For now, you can test in one of the target languages, e.g. call Fusion code from C# and catch the exception in C# (either directly or with one of the unit test frameworks). |
Beta Was this translation helpful? Give feedback.
-
|
Regarding exception handling in C, what is your opinion on transpiling exceptions to |
Beta Was this translation helpful? Give feedback.
-
|
@pfusik You don't have to introduce exceptions to the fusion language, because not all target languages support it well. I think it would be way better to introduce a convention from go-language, which just returns a tuple informing about an error, something like that: Yes, each caller needs to read it and pass it along, but it's already doable in all of the target. There can be supporting methods that make using such things easier to use. Exceptions are essentially control flow elements that cut across call stack, and it's hard to streamline across all targets. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm thinking of writing test classes in Fusion to test my code. But how could we test that a function that throws exceptions throws one when it is expected to throw? The first way that comes to mind is being able to catch a thrown exception.
Beta Was this translation helpful? Give feedback.
All reactions