Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed May 24, 2024
1 parent 9d8a589 commit 454a37c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
8 changes: 6 additions & 2 deletions packages/property-provider/src/CredentialsProviderError.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Logger } from "@smithy/types";

import { ProviderError, ProviderErrorOptionsType } from "./ProviderError";

/**
Expand All @@ -17,17 +15,23 @@ export class CredentialsProviderError extends ProviderError {
name = "CredentialsProviderError";

/**
* @override
* @deprecated constructor should be given a logger.
*/
public constructor(message: string);
/**
* @override
* @deprecated constructor should be given a logger.
*/
public constructor(message: string, tryNextLink: boolean | undefined);
/**
* @override
* This signature is preferred for logging capability.
*/
public constructor(message: string, options: ProviderErrorOptionsType);
/**
* @override
*/
public constructor(message: string, options: boolean | ProviderErrorOptionsType = true) {
super(message, options as ProviderErrorOptionsType);
Object.setPrototypeOf(this, CredentialsProviderError.prototype);
Expand Down
2 changes: 1 addition & 1 deletion packages/property-provider/src/ProviderError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class ProviderError extends Error {
super(message);
this.tryNextLink = tryNextLink;
Object.setPrototypeOf(this, ProviderError.prototype);
logger?.debug?.(`${this.constructor?.name} ${tryNextLink ? "->" : "(!)"} ${message}`);
logger?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
}

/**
Expand Down
7 changes: 7 additions & 0 deletions packages/property-provider/src/TokenProviderError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,25 @@ import { ProviderError, ProviderErrorOptionsType } from "./ProviderError";
*/
export class TokenProviderError extends ProviderError {
name = "TokenProviderError";

/**
* @override
* @deprecated constructor should be given a logger.
*/
public constructor(message: string);
/**
* @override
* @deprecated constructor should be given a logger.
*/
public constructor(message: string, tryNextLink: boolean | undefined);
/**
* @override
* This signature is preferred for logging capability.
*/
public constructor(message: string, options: ProviderErrorOptionsType);
/**
* @override
*/
public constructor(message: string, options: boolean | ProviderErrorOptionsType = true) {
super(message, options as ProviderErrorOptionsType);
Object.setPrototypeOf(this, TokenProviderError.prototype);
Expand Down

0 comments on commit 454a37c

Please sign in to comment.