Skip to content

Commit

Permalink
Fix confusing function throw
Browse files Browse the repository at this point in the history
  • Loading branch information
magtastic committed Feb 28, 2024
1 parent 825eafc commit e455b8f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/view-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class ViewController {
log.start({ _id: this.id });

if (this.id === null) {
throw this.errNoViewReference();
throw this.errNoViewReference;
}

const finalEventHandlers: Partial<EventHandlers> = {
Expand Down Expand Up @@ -208,8 +208,6 @@ export class ViewController {
return unsubscribe;
}

private errNoViewReference(): AdaptyError {
// TODO: Make a separate error type once AdaptyError is refactored
throw new Error('View reference not found');
}
// TODO: Make a separate error type once AdaptyError is refactored
private errNoViewReference = new Error('View reference not found');
}

0 comments on commit e455b8f

Please sign in to comment.