Fix type errors due to unknow type in try catch

This commit is contained in:
Labhansh Agrawal 2021-08-30 13:37:13 +00:00
parent b5cc6e7662
commit c6dfab9e67
6 changed files with 17 additions and 9 deletions

View file

@ -16,7 +16,8 @@ const _extract = (script?: vm.Script): Record<string, any> => {
const _syntaxValidation = (cfg: string) => {
try {
return new vm.Script(cfg, {filename: '.hyper.js', displayErrors: true});
} catch (err) {
} catch (_err) {
const err = _err as {name: string};
notify(`Error loading config: ${err.name}`, `${err}`, {error: err});
}
};