Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
fix: ensure we only throw something of type Error
Browse files Browse the repository at this point in the history
  • Loading branch information
pamapa committed Mar 15, 2022
1 parent f811496 commit b9c2a38
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/oidc-client-ts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export class Logger {
// (undocumented)
static info(name: string, ...args: unknown[]): void;
// (undocumented)
throw(err: unknown): never;
throw(err: Error): never;
// (undocumented)
warn(...args: unknown[]): void;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion src/SessionMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class SessionMonitor {

public constructor(private readonly _userManager: UserManager) {
if (!_userManager) {
this._logger.throw("No user manager passed to SessionMonitor");
this._logger.throw(new Error("No user manager passed"));
}

this._userManager.events.addUserLoaded(this._start);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class Logger {
}
}

public throw(err: unknown): never {
public throw(err: Error): never {
this.error(err);
throw err;
}
Expand Down

0 comments on commit b9c2a38

Please sign in to comment.