diff --git a/src/context/directory/index.ts b/src/context/directory/index.ts index bc5d211c7..94b1e5147 100644 --- a/src/context/directory/index.ts +++ b/src/context/directory/index.ts @@ -153,7 +153,7 @@ export default class DirectoryContext { await handler.dump(this); } catch (err) { log.debug(err.stack); - throw new Error(`Problem exporting ${name}`); + throw new Error(`Problem exporting ${name}`, { cause: err }); } }) ); diff --git a/src/context/yaml/index.ts b/src/context/yaml/index.ts index 5a965cd9f..68a9d324a 100644 --- a/src/context/yaml/index.ts +++ b/src/context/yaml/index.ts @@ -202,7 +202,7 @@ export default class YAMLContext { } } catch (err) { log.debug(err.stack); - throw new Error(`Problem exporting ${name}`); + throw new Error(`Problem exporting ${name}`, { cause: err }); } }) );