Skip to content

Add option to remove throws keyword from RouterMethods handlers #785

@Cyberbeni

Description

@Cyberbeni

Reading this thread reminded me of an occasion when I accidentally left a top level throw inside a get handler in one of my projects. I would prefer if this wasn't allowed, so I am forced to make a conscious decision whether it's a 400 or a 500 error (or a rare case when it's something else) instead of automatically converting the error to a 500(?) response for me.

The actual implementation would probably be #if TRAIT around typalias any Error/Never and then using typed throws with that type.

Hopefully the final release of 6.3 keeps the fix, so non-default traits become easily usable for everyone: #769 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions