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

@@ -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';
}
}
};