Skip to content

Support overriding the ? behavior locally (by redefining the try! macro) #71643

Closed
@stevenroose

Description

@stevenroose

When the ? operator was implemented, it looks like it was meant to be equivalent to the try! macro.

This has the nice property that overriding the try! macro in your own project, allows you to capture all the ? invocations and add additional logic like logging file and line number or wrapping that information into a new error object.

Sadly it seems that the ? operator is no longer equivalent to the try! macro. So overriding try! does not change the behavior of ? in your project. It would be awesome if this would be made possible.

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