@smithy/property-provider
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -34,10 +34,24 @@ var __defProp = Object.defineProperty; | ||
var _ProviderError = class _ProviderError extends Error { | ||
constructor(message, tryNextLink = true) { | ||
constructor(message, options = true) { | ||
var _a; | ||
let logger; | ||
let tryNextLink = true; | ||
if (typeof options === "boolean") { | ||
logger = void 0; | ||
tryNextLink = options; | ||
} else if (options != null && typeof options === "object") { | ||
logger = options.logger; | ||
tryNextLink = options.tryNextLink ?? true; | ||
} | ||
super(message); | ||
this.name = "ProviderError"; | ||
this.tryNextLink = tryNextLink; | ||
this.name = "ProviderError"; | ||
Object.setPrototypeOf(this, _ProviderError.prototype); | ||
(_a = logger == null ? void 0 : logger.debug) == null ? void 0 : _a.call(logger, `@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); | ||
} | ||
static from(error, tryNextLink = true) { | ||
return Object.assign(new this(error.message, tryNextLink), error); | ||
/** | ||
* @deprecated use new operator. | ||
*/ | ||
static from(error, options = true) { | ||
return Object.assign(new this(error.message, options), error); | ||
} | ||
@@ -50,5 +64,7 @@ }; | ||
var _CredentialsProviderError = class _CredentialsProviderError extends ProviderError { | ||
constructor(message, tryNextLink = true) { | ||
super(message, tryNextLink); | ||
this.tryNextLink = tryNextLink; | ||
/** | ||
* @override | ||
*/ | ||
constructor(message, options = true) { | ||
super(message, options); | ||
this.name = "CredentialsProviderError"; | ||
@@ -63,5 +79,7 @@ Object.setPrototypeOf(this, _CredentialsProviderError.prototype); | ||
var _TokenProviderError = class _TokenProviderError extends ProviderError { | ||
constructor(message, tryNextLink = true) { | ||
super(message, tryNextLink); | ||
this.tryNextLink = tryNextLink; | ||
/** | ||
* @override | ||
*/ | ||
constructor(message, options = true) { | ||
super(message, options); | ||
this.name = "TokenProviderError"; | ||
@@ -68,0 +86,0 @@ Object.setPrototypeOf(this, _TokenProviderError.prototype); |
import { ProviderError } from "./ProviderError"; | ||
export class CredentialsProviderError extends ProviderError { | ||
constructor(message, tryNextLink = true) { | ||
super(message, tryNextLink); | ||
this.tryNextLink = tryNextLink; | ||
constructor(message, options = true) { | ||
super(message, options); | ||
this.name = "CredentialsProviderError"; | ||
@@ -7,0 +6,0 @@ Object.setPrototypeOf(this, CredentialsProviderError.prototype); |
export class ProviderError extends Error { | ||
constructor(message, tryNextLink = true) { | ||
constructor(message, options = true) { | ||
let logger; | ||
let tryNextLink = true; | ||
if (typeof options === "boolean") { | ||
logger = undefined; | ||
tryNextLink = options; | ||
} | ||
else if (options != null && typeof options === "object") { | ||
logger = options.logger; | ||
tryNextLink = options.tryNextLink ?? true; | ||
} | ||
super(message); | ||
this.name = "ProviderError"; | ||
this.tryNextLink = tryNextLink; | ||
this.name = "ProviderError"; | ||
Object.setPrototypeOf(this, ProviderError.prototype); | ||
logger?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); | ||
} | ||
static from(error, tryNextLink = true) { | ||
return Object.assign(new this(error.message, tryNextLink), error); | ||
static from(error, options = true) { | ||
return Object.assign(new this(error.message, options), error); | ||
} | ||
} |
import { ProviderError } from "./ProviderError"; | ||
export class TokenProviderError extends ProviderError { | ||
constructor(message, tryNextLink = true) { | ||
super(message, tryNextLink); | ||
this.tryNextLink = tryNextLink; | ||
constructor(message, options = true) { | ||
super(message, options); | ||
this.name = "TokenProviderError"; | ||
@@ -7,0 +6,0 @@ Object.setPrototypeOf(this, TokenProviderError.prototype); |
@@ -1,2 +0,2 @@ | ||
import { ProviderError } from "./ProviderError"; | ||
import { ProviderError, ProviderErrorOptionsType } from "./ProviderError"; | ||
/** | ||
@@ -14,5 +14,18 @@ * @public | ||
export declare class CredentialsProviderError extends ProviderError { | ||
readonly tryNextLink: boolean; | ||
name: string; | ||
constructor(message: string, tryNextLink?: boolean); | ||
/** | ||
* @override | ||
* @deprecated constructor should be given a logger. | ||
*/ | ||
constructor(message: string); | ||
/** | ||
* @override | ||
* @deprecated constructor should be given a logger. | ||
*/ | ||
constructor(message: string, tryNextLink: boolean | undefined); | ||
/** | ||
* @override | ||
* This signature is preferred for logging capability. | ||
*/ | ||
constructor(message: string, options: ProviderErrorOptionsType); | ||
} |
@@ -0,3 +1,11 @@ | ||
import { Logger } from "@smithy/types"; | ||
/** | ||
* @public | ||
*/ | ||
export type ProviderErrorOptionsType = { | ||
tryNextLink?: boolean | undefined; | ||
logger?: Logger; | ||
}; | ||
/** | ||
* @public | ||
* | ||
@@ -13,6 +21,20 @@ * An error representing a failure of an individual provider. | ||
export declare class ProviderError extends Error { | ||
name: string; | ||
readonly tryNextLink: boolean; | ||
name: string; | ||
constructor(message: string, tryNextLink?: boolean); | ||
static from(error: Error, tryNextLink?: boolean): ProviderError; | ||
/** | ||
* @deprecated constructor should be given a logger. | ||
*/ | ||
constructor(message: string); | ||
/** | ||
* @deprecated constructor should be given a logger. | ||
*/ | ||
constructor(message: string, tryNextLink: boolean | undefined); | ||
/** | ||
* This signature is preferred for logging capability. | ||
*/ | ||
constructor(message: string, options: ProviderErrorOptionsType); | ||
/** | ||
* @deprecated use new operator. | ||
*/ | ||
static from(error: Error, options?: boolean | ProviderErrorOptionsType): ProviderError; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { ProviderError } from "./ProviderError"; | ||
import { ProviderError, ProviderErrorOptionsType } from "./ProviderError"; | ||
/** | ||
@@ -14,5 +14,18 @@ * @public | ||
export declare class TokenProviderError extends ProviderError { | ||
readonly tryNextLink: boolean; | ||
name: string; | ||
constructor(message: string, tryNextLink?: boolean); | ||
/** | ||
* @override | ||
* @deprecated constructor should be given a logger. | ||
*/ | ||
constructor(message: string); | ||
/** | ||
* @override | ||
* @deprecated constructor should be given a logger. | ||
*/ | ||
constructor(message: string, tryNextLink: boolean | undefined); | ||
/** | ||
* @override | ||
* This signature is preferred for logging capability. | ||
*/ | ||
constructor(message: string, options: ProviderErrorOptionsType); | ||
} |
@@ -1,2 +0,2 @@ | ||
import { ProviderError } from "./ProviderError"; | ||
import { ProviderError, ProviderErrorOptionsType } from "./ProviderError"; | ||
/** | ||
@@ -14,5 +14,18 @@ * @public | ||
export declare class CredentialsProviderError extends ProviderError { | ||
readonly tryNextLink: boolean; | ||
name: string; | ||
constructor(message: string, tryNextLink?: boolean); | ||
/** | ||
* @override | ||
* @deprecated constructor should be given a logger. | ||
*/ | ||
constructor(message: string); | ||
/** | ||
* @override | ||
* @deprecated constructor should be given a logger. | ||
*/ | ||
constructor(message: string, tryNextLink: boolean | undefined); | ||
/** | ||
* @override | ||
* This signature is preferred for logging capability. | ||
*/ | ||
constructor(message: string, options: ProviderErrorOptionsType); | ||
} |
@@ -0,3 +1,11 @@ | ||
import { Logger } from "@smithy/types"; | ||
/** | ||
* @public | ||
*/ | ||
export type ProviderErrorOptionsType = { | ||
tryNextLink?: boolean | undefined; | ||
logger?: Logger; | ||
}; | ||
/** | ||
* @public | ||
* | ||
@@ -13,6 +21,20 @@ * An error representing a failure of an individual provider. | ||
export declare class ProviderError extends Error { | ||
name: string; | ||
readonly tryNextLink: boolean; | ||
name: string; | ||
constructor(message: string, tryNextLink?: boolean); | ||
static from(error: Error, tryNextLink?: boolean): ProviderError; | ||
/** | ||
* @deprecated constructor should be given a logger. | ||
*/ | ||
constructor(message: string); | ||
/** | ||
* @deprecated constructor should be given a logger. | ||
*/ | ||
constructor(message: string, tryNextLink: boolean | undefined); | ||
/** | ||
* This signature is preferred for logging capability. | ||
*/ | ||
constructor(message: string, options: ProviderErrorOptionsType); | ||
/** | ||
* @deprecated use new operator. | ||
*/ | ||
static from(error: Error, options?: boolean | ProviderErrorOptionsType): ProviderError; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { ProviderError } from "./ProviderError"; | ||
import { ProviderError, ProviderErrorOptionsType } from "./ProviderError"; | ||
/** | ||
@@ -14,5 +14,18 @@ * @public | ||
export declare class TokenProviderError extends ProviderError { | ||
readonly tryNextLink: boolean; | ||
name: string; | ||
constructor(message: string, tryNextLink?: boolean); | ||
/** | ||
* @override | ||
* @deprecated constructor should be given a logger. | ||
*/ | ||
constructor(message: string); | ||
/** | ||
* @override | ||
* @deprecated constructor should be given a logger. | ||
*/ | ||
constructor(message: string, tryNextLink: boolean | undefined); | ||
/** | ||
* @override | ||
* This signature is preferred for logging capability. | ||
*/ | ||
constructor(message: string, options: ProviderErrorOptionsType); | ||
} |
{ | ||
"name": "@smithy/property-provider", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35573
632