Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error handling #33

Open
kaste opened this issue Apr 19, 2018 · 3 comments
Open

Better error handling #33

kaste opened this issue Apr 19, 2018 · 3 comments

Comments

@kaste
Copy link
Contributor

kaste commented Apr 19, 2018

Adopt the following code

https://github.com/ikappas/vscode-phpcs/blob/5ec0314d0187f8cedd004a453b6859ff948664bd/phpcs-server/src/linter.ts#L187-L206

Since stderr is always an error, we can switch to STREAM_BOTH mode (which is the default) and will get some automatic handling for SL >4.3

Parsing fatal errors within stdin, is marked 'needs help'

kaste added a commit that referenced this issue Apr 19, 2018
Partially tackles #33

Switching to STREAM_BOTH means SL can handle stderr output automatically (SL version >4.3 required).
@kaste
Copy link
Contributor Author

kaste commented Apr 19, 2018

Basically the implementation could be

def find_errors(self, stdout):
	if SOME_ERROR_REGEX.matches(stdout):
		logger.warning('Dada')
		self.notify_failure()
		return
	return super().find_errors(stdout)

But you need to write the regexes and test this, I don't have phpcs installed. 😢

@braver braver self-assigned this Mar 14, 2019
@braver braver removed their assignment Sep 5, 2020
@skeeith
Copy link

skeeith commented Oct 16, 2022

any updates from this?

@kaste
Copy link
Contributor Author

kaste commented Oct 16, 2022

Na, you can implement this, @skeeith.

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

No branches or pull requests

3 participants