Skip to content

Commit

Permalink
apply feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
xeho91 committed Dec 13, 2024
1 parent 9c4d33c commit 541b606
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/indexer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const createIndexer = (legacyTemplate: boolean): Indexer => ({
error instanceof GetDefineMetaFirstArgumentError
) {
const { filename } = error;
throw new LegacyTemplateNotEnabledError(filename);
throw new LegacyTemplateNotEnabledError(filename, { cause: error });
}

// WARN: We can't use `instanceof StorybookSvelteCSFError`, because is an _abstract_ class
Expand Down
3 changes: 2 additions & 1 deletion src/utils/error/legacy-api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ export class LegacyTemplateNotEnabledError extends StorybookSvelteCSFError {
readonly code = 2;
public documentation = true;

constructor(filename?: string) {
constructor(filename?: string, options?: ConstructorParameters<typeof Error>[1]) {
super({ filename });
this.cause = options?.cause;
}

template(): string {
Expand Down

0 comments on commit 541b606

Please sign in to comment.