-
Notifications
You must be signed in to change notification settings - Fork 13
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
chore: move error parsing backend-side and return error path to frontend #189
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
b130ad9
to
4df4022
Compare
9a0e5ac
to
1a5cfe1
Compare
@@ -105,6 +105,15 @@ export const validateOtelCol = async (otelcolRealPath: string, configPath: strin | |||
}); | |||
}; | |||
|
|||
const extractErrorPath = (errorMessage: string) => { | |||
const errorPathMatch = errorMessage.match(/^(?:((?:\w+\:\:)+(?:\w+))\:\s+).*/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: This regex will fail when the path is not at the beginning of the message, or when there are named pipelines. An alternative could be:
const errorPathMatch = errorMessage.match(/^(?:((?:\w+\:\:)+(?:\w+))\:\s+).*/); | |
const errorPathMatch = errorMessage.match(/(\w+(::[^: ]+)*):/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot about named pipelines, I'll add some tests for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About the path not being at the begging of the message: ADOT has an Error: Invalid configuration:
prefix that we already today strip. Besides maybe some other prefixes, I would be surprised if that is a Distro-dependent thing. But luckily, with this change, it becomes a distro qualification test, and we will know when we need to make the regex better it :-)
1db512a
to
3e5b63d
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
No description provided.