Skip to content

Pass `context' to error formatters#756

Merged
johnnyreilly merged 1 commit intoTypeStrong:masterfrom
gustavderdrache:add-error-context
Apr 7, 2018
Merged

Pass `context' to error formatters#756
johnnyreilly merged 1 commit intoTypeStrong:masterfrom
gustavderdrache:add-error-context

Conversation

@gustavderdrache
Copy link
Copy Markdown
Contributor

This PR adds the context variable to the ErrorInfo interface. The primary use case is here is to allow custom error formatters to recover the full path to the file in which an error occurred, since I wanted to read the file from disk to use 'babel-code-frame' to go along with the message.

I couldn't find tests that exercise errorFormatter functionality, but I'm happy to write some extras if you'd like.

@johnnyreilly
Copy link
Copy Markdown
Member

Thanks for this! Let me have a ponder and report back.

@johnnyreilly
Copy link
Copy Markdown
Member

Yeah - I'm happy to take this. I'll merge as is and fix the tests myself. Thanks for contributing!

@johnnyreilly johnnyreilly merged commit 3a73e62 into TypeStrong:master Apr 7, 2018
@johnnyreilly
Copy link
Copy Markdown
Member

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants