File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -208,21 +208,19 @@ export class MarkdownDb<
208
208
const headerData = await new Promise ( ( resolve ) =>
209
209
resolve ( md . getHeaderData ( mdText ) ) ,
210
210
) . catch ( async ( err ) => {
211
- throw new Error ( t `
212
- Failed to read markdown file header
213
- - File: ${ this . _cwd . relativePathTo ( mdFile ) }
214
- - Error:
215
- ${ err . message as string }
216
- ` ) ;
211
+ throw new Error (
212
+ `Failed to read markdown file header for ${ this . _cwd . relativePathTo ( mdFile ) } ` ,
213
+ { cause : err } ,
214
+ ) ;
217
215
} ) ;
218
216
219
217
// Validate the header data
220
218
const parsedData = this . _configSchema . safeParse ( headerData ) ;
221
219
if ( ! parsedData . success )
222
- throw new Error ( t `
223
- Failed to parse config for ${ mdFile . path } :
224
- ${ z . prettifyError ( parsedData . error ) }
225
- ` ) ;
220
+ throw new Error (
221
+ ` Failed to parse config for ${ this . _cwd . relativePathTo ( mdFile ) } ` ,
222
+ { cause : parsedData . error } ,
223
+ ) ;
226
224
227
225
// Compute the entry id
228
226
const { name, type } = this . computeEntryId ( mdFile ) ;
You can’t perform that action at this time.
0 commit comments