Skip to content

Ship a single shared instance of TwirpError rather than per-service #172

@noahseger

Description

@noahseger

Preflight Checklist

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions