Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Catch fatal errors in visitName. #866

Closed
wants to merge 2 commits into from
Closed

Catch fatal errors in visitName. #866

wants to merge 2 commits into from

Conversation

hermanventer
Copy link
Contributor

Introspection errors no longer show up as completions, so any time we evaluate a node that might cause an introspection error, we should expect to catch and handle a FatalError.

Also tweaked package.json to allow longer stack traces when running test-serializer and tweaked test-internal to output error messages that do not have associated source locations. (The latter should not happen in practice but could happen when things go wrong.)

@@ -98,13 +99,25 @@ export let ClosureRefReplacer = {
},
};

// todo: make a test case that throws a FatalError when calling this. First try a residual function with a reference
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you did the todo?

true
);
} catch (e) {
if (!(e instanceof FatalError)) throw e;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tryQuery is used from a few more places. I think the whole error-handling logic should move into tryQuery.

@facebook-github-bot
Copy link

@hermanventer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@hermanventer hermanventer deleted the visitname branch August 4, 2017 19:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants