You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mark the method addDiagnostic in TransformationContext as public and read the diagnostic result in the compiler
Use Cases
I'm writing a custom transformer. In some cases, the transform will fail but I don't want to throw an Error. I want to add my error to the diagnostics.
I'd like to see this in public as well. In my transformer there are cases where I'm 100% sure that the error is possible and I need to notify about that somehow.
Search Terms
custom transformer diagnostic
Suggestion
mark the method
addDiagnostic
inTransformationContext
as public and read the diagnostic result in the compilerUse Cases
I'm writing a custom transformer. In some cases, the transform will fail but I don't want to throw an Error. I want to add my error to the diagnostics.
Examples
I have tried to call the
addDiagnostic
by as anyBut that doesn't work. After digging into the source code, I found that it seems like the diagnostics only read in the
dts
generating.Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: