General X++ Development
How do I catch an inner exception in X++?
How do I catch an inner exception in X++?
1 answer
Write an answerFor a CLR/.NET exception, walk the inner exception chain.
catch (Exception::CLRError)
{
System.Exception ex = CLRInterop::getLastException();
while (ex)
{
warning(ex.get_Message());
ex = ex.get_InnerException();
}
}The top-level message is often generic. The actual reason can be one or two exceptions deeper.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer