Question about in-line custom error types. #3806
-
|
I was wondering if an in-line error type declaration like this was workable? Goa gen runs successfully, but the resultant code seems to have errors in the gRPC section. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
As a follow-up question, why do the autogenerated makeError functions take in an error as an argument? |
Beta Was this translation helpful? Give feedback.
-
|
I don't think this pattern is being used but it should be possible to support it. In any case the current behavior of generating incorrect code is clearly a bug, it should either generate workable code or error at generation time. The generated |
Beta Was this translation helpful? Give feedback.
I don't think this pattern is being used but it should be possible to support it. In any case the current behavior of generating incorrect code is clearly a bug, it should either generate workable code or error at generation time.
The generated
MakeXYZErrorfunction use the error message to create the underlying Goa error data structure. The idea is that when you want to return an error you probably already have one you just want to wrap with the generated function.