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

Issue with regex used to identify clickhouse error messages #104

Open
mike-luabase opened this issue Jan 1, 2022 · 7 comments
Open

Issue with regex used to identify clickhouse error messages #104

mike-luabase opened this issue Jan 1, 2022 · 7 comments

Comments

@mike-luabase
Copy link

The regex used to catch error messages from the clickhouse server is missing error codes with 3 digits e.g. error code 215. The change below would fix it, but I don't know clickhouse well enough to determine if this will cause other issues.

const R_ERROR = new RegExp('(Code|Error): .*Exception: (.+?)$', 'm');
@mike-luabase
Copy link
Author

@TimonKK is there any reason we need to keep the ([0-9]{2})[,.] part of the regex?

@mike-luabase
Copy link
Author

I see you updated here in September, can we drop the # check?

a84d890

@TimonKK
Copy link
Owner

TimonKK commented Jan 25, 2022

What do you mean about "drop the # check"?

@mike-luabase
Copy link
Author

@TimonKK the current regex is checking if there are numbers (([0-9]{2})[,.]) in the error code, is that necessary? If so, it'd need to check for at least three digits.

@TimonKK
Copy link
Owner

TimonKK commented Jan 26, 2022

I know ClickHouse has two digital error codes, for example, ClickHouse/ClickHouse#33839. So I think to adjust regexp to '(Code|Error): ([0-9]{2,})[,.] .*Exception: (.+?)$'

@mike-luabase
Copy link
Author

@TimonKK The problem is there are now three digit error codes, e.g. I got 215

@TimonKK
Copy link
Owner

TimonKK commented Jan 26, 2022

I understood about three-digit error codes. And I suggested new regexp /(Code|Error): ([0-9]{2,})[,.] .*Exception: (.+?)$/. You could test it on https://regexr.com/

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

No branches or pull requests

2 participants