Skip to content

Commit f355c41

Browse files
committed
feat: use serverless error class
1 parent e0e5e24 commit f355c41

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ServerlessAWSSecret {
2525
const { SecretString } = await client.send(command);
2626

2727
if (!SecretString) {
28-
throw new Error(`Failed to retrieve the secret: ${this.options.secretId}`);
28+
throw new this.serverless.classes.Error(`Failed to retrieve the secret: ${this.options.secretId}`);
2929
}
3030

3131
const secrets = JSON.parse(SecretString);

src/index.types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export interface Serverless {
1313
};
1414
};
1515
};
16+
classes: {
17+
Error: ErrorConstructor;
18+
};
1619
}
1720

1821
export interface ServerlessSecretHooks {

0 commit comments

Comments
 (0)