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
I have searched the issue tracker for an issue that matches the one I want to file, without success.
Problem Description
We have a lot of service definitions, and each one generates a separate TwirpError class. It would be nice to have a single instance.
Benefits:
Allows generic middleware to throw TwirpErrors without relying on any individual service
Less PHP code to load
Proposed Solution
We could make this change in a backwards-compatible way by including a new protoc option to disable generating TwirpError and instead import it from twirphp directly.
Alternatives Considered
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Allows generic middleware to throw TwirpErrors without relying on any individual service
You can already use the Twirp\Error interface to handle errors.
We could make this change in a backwards-compatible way by including a new protoc option to disable generating TwirpError and instead import it from twirphp directly.
Sounds good to me. Would you be willing to provide a PR?
@sagikazarmark thanks so much for validating — yes, of course we can contribute a PR :) It might be a few weeks but will be a big help if you can review.
Preflight Checklist
Problem Description
We have a lot of service definitions, and each one generates a separate
TwirpError
class. It would be nice to have a single instance.Benefits:
Proposed Solution
We could make this change in a backwards-compatible way by including a new protoc option to disable generating
TwirpError
and instead import it fromtwirphp
directly.Alternatives Considered
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: