mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Enable useUnknownInCatchVariables for stricter type checking in catch blocks (#50591)
* wrap a bunch of errors * wrap more things! * fix up some unit tests * wrap more errors * tiny bit of tidy up
This commit is contained in:
@@ -49,9 +49,11 @@ export function buildVisualQueryFromString(expr: string): Context {
|
||||
} catch (err) {
|
||||
// Not ideal to log it here, but otherwise we would lose the stack trace.
|
||||
console.error(err);
|
||||
context.errors.push({
|
||||
text: err.message,
|
||||
});
|
||||
if (err instanceof Error) {
|
||||
context.errors.push({
|
||||
text: err.message,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// If we have empty query, we want to reset errors
|
||||
|
||||
Reference in New Issue
Block a user