Skip to content

Return error if reverse() does not find a match #2615

@akhayyat

Description

@akhayyat

Issue Description

Currently, reverse() fails silently in case a matching route is not found, returning an empty string.
Would it be possible to make it fail a little louder, returning an error?
Ideally, a compile-time error would be perfect, but a run-time error is still better than failing silently.

Expected behaviour

Compile-time or run-time error if the provided route name does not exist.

Actual behaviour

Empty string URL.

Steps to reproduce

ctx.Echo().Reverse("undefined-route-name")

Version/commit

v4.11.3

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