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:
@@ -68,7 +68,11 @@ export const APIEditor: FC<StandardEditorProps<APIEditorConfig, any, any>> = (pr
|
||||
const json = JSON.parse(data);
|
||||
return <JSONFormatter json={json} />;
|
||||
} catch (error) {
|
||||
return `Invalid JSON provided: ${error.message}`;
|
||||
if (error instanceof Error) {
|
||||
return `Invalid JSON provided: ${error.message}`;
|
||||
} else {
|
||||
return 'Invalid JSON provided';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user