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:
Ashley Harrison
2022-06-15 08:59:29 +01:00
committed by GitHub
parent 2fbe99c1be
commit 803473f479
62 changed files with 364 additions and 177 deletions

View File

@@ -6,7 +6,7 @@ import { Subscription } from 'rxjs';
import { FieldConfigSource, GrafanaTheme2 } from '@grafana/data';
import { selectors } from '@grafana/e2e-selectors';
import { locationService } from '@grafana/runtime';
import { isFetchError, locationService } from '@grafana/runtime';
import {
HorizontalGroup,
InlineSwitch,
@@ -163,7 +163,9 @@ export class PanelEditorUnconnected extends PureComponent<Props> {
await saveAndRefreshLibraryPanel(this.props.panel, this.props.dashboard.meta.folderId!);
this.props.notifyApp(createPanelLibrarySuccessNotification('Library panel saved'));
} catch (err) {
this.props.notifyApp(createPanelLibraryErrorNotification(`Error saving library panel: "${err.statusText}"`));
if (isFetchError(err)) {
this.props.notifyApp(createPanelLibraryErrorNotification(`Error saving library panel: "${err.statusText}"`));
}
}
return;
}