Skip to content

Tolerate the case where phpactor returns an error - #13

Merged
dantleech merged 1 commit into
masterfrom
tolerate-errors
Dec 19, 2018
Merged

dantleech merged 1 commit into
masterfrom
tolerate-errors

Conversation

@dantleech

Copy link
Copy Markdown
Collaborator

Phpactor throws exceptions in some cases (for example when classes cannot be located). In these cases it returns a JSON response with {"error": "blah"} and does not have the ['suggestions'] key.

This PR returns early if the suggestions key is not present.

The response from Phpactor is logged in NCM2. Phpactor does not log errors encountered during normal command execution (RPC errors are logged however). PR in Phpactor to fix this here

@dantleech

dantleech commented Dec 18, 2018 •

Copy link
Copy Markdown
Collaborator Author

cc @roxma from looking at the tern implementation, this is the standard way to handle this scenario?

@roxma

roxma commented Dec 19, 2018 •

Copy link
Copy Markdown
Collaborator

There's no standard way actually. We could filter-out annoying error, unless we never expect it to happen.

This PR looks good to me.

@dantleech
dantleech merged commit c7f09c6 into master Dec 19, 2018
@dantleech
dantleech deleted the tolerate-errors branch December 19, 2018 07:34
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