Closed tjanczuk closed 3 months ago
@irisclasson, @glennblock if you have ideas how to improve this experience, I am all ears.
Some background first. Edge allows two representations of inline C# code: a full class or class library code, or an async lambda expression. Edge attempts to compile the code first as a class library, and if that fails, as an async lambda expression. Only if both fail, an exception is thrown, like the above. That is why you see the two sections in that exception text: ----> Errors when compiling as a CLR library:
and ----> Errors when compiling as a CLR async lambda expression:
. Depending on what your intention was as a developer, one of these sections will contain the root cause of the problem.
With the current support for structured exceptions, this could be addressed by throwing an AggregateException with inner exceptions having more fine grained details.
Currently inline C# code compilation errors surface in the form of exceptions from
edge.func
. These exceptions are cryptic and not very helpful in diagnosing the root cause of the issue. What can be done to improve the experience?A typical exception looks like this: