Skip to content

Commit

Permalink
chore(dsl): add Error suffix to ExcessiveOptionalNestingError
Browse files Browse the repository at this point in the history
  • Loading branch information
jo3-l committed Jul 4, 2023
1 parent ddcea55 commit 584ceeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dsl/syntax/untrusted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function parseUntrustedPattern(

const depth = determineOptionalNestingDepth(ast);
if (depth > maxOptionalNestingDepth) {
throw new ExcessiveOptionalNesting(pattern, maxOptionalNestingDepth, depth);
throw new ExcessiveOptionalNestingError(pattern, maxOptionalNestingDepth, depth);
}
return ast;
}
Expand Down Expand Up @@ -102,7 +102,7 @@ export function determineOptionalNestingDepth(ast: Ast) {
return ast.nodes.reduce((max, node) => Math.max(max, visit(node)), 0);
}

export class ExcessiveOptionalNesting extends Error {
export class ExcessiveOptionalNestingError extends Error {
public readonly pattern: string;
public readonly depthLimit: number;
public readonly actualDepth: number;
Expand Down

0 comments on commit 584ceeb

Please sign in to comment.