Skip to content

Catch name_mapper exceptions #3889

Open
@gabelevi

Description

@gabelevi

You can write name mappers like

module.name_mapper='foo\(bar\)?' -> '\1'

which will error since the matching group might not exist. This leads to an uncaught exception. This should be easy to fix - we should wrap the Str.global_replace calls in https://github.com/facebook/flow/blob/master/src/services/inference/module_js.ml with try/with blocks, emit an error, and soldier on.

Thanks @billschaller for the report!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions