mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 02:42:41 +02:00
refactor: unify error handling behavior (#6755)
* refactor: unify error handling behavior * revert * normalize paths * test... * change * does this work... * fix... * maybe fix * maybe fix * fix * fix...
This commit is contained in:
parent
dcbf9f644e
commit
f903422617
58 changed files with 1123 additions and 299 deletions
|
@ -48,10 +48,10 @@ export async function getDataFileData<T>(
|
|||
const contentString = await fs.readFile(filePath, {encoding: 'utf8'});
|
||||
const unsafeContent = Yaml.load(contentString);
|
||||
return validate(unsafeContent);
|
||||
} catch (e) {
|
||||
} catch (err) {
|
||||
// TODO replace later by error cause, see https://v8.dev/features/error-cause
|
||||
logger.error`The ${params.fileType} file at path=${filePath} looks invalid.`;
|
||||
throw e;
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue