@@ -21,31 +21,20 @@ export class InvalidMappingError extends CustomError {
2121 }
2222}
2323
24- export class NotFoundError extends Error {
24+ export class NotFoundError extends CustomError {
2525 public resourceName : string ;
2626
2727 constructor ( resourceName : string , message : string ) {
28- super ( message ) ;
29- this . name = "NotFoundError" ;
28+ super ( "NotFoundError" , message ) ;
3029 this . resourceName = resourceName ;
31-
32- if ( Error . captureStackTrace ) {
33- Error . captureStackTrace ( this , this . constructor ) ;
34- }
3530 }
3631}
37-
38- export class RequestError extends Error {
32+ export class RequestError extends CustomError {
3933 public endpoint : string | undefined ;
4034
4135 constructor ( message : string , endpoint ?: string ) {
42- super ( message ) ;
43- this . name = "RequestError" ;
36+ super ( "RequestError" , message ) ;
4437 this . endpoint = endpoint ;
45-
46- if ( Error . captureStackTrace ) {
47- Error . captureStackTrace ( this , this . constructor ) ;
48- }
4938 }
5039}
5140
@@ -55,24 +44,14 @@ export class UnsupportedActionError extends CustomError {
5544 }
5645}
5746
58- export class InvalidFormatError extends Error {
47+ export class InvalidFormatError extends CustomError {
5948 constructor ( message : string ) {
60- super ( message ) ;
61- this . name = "InvalidFormatError" ;
62-
63- if ( Error . captureStackTrace ) {
64- Error . captureStackTrace ( this , this . constructor ) ;
65- }
49+ super ( "InvalidFormatError" , message ) ;
6650 }
6751}
6852
69- export class SdkNotConfiguredError extends Error {
53+ export class SdkNotConfiguredError extends CustomError {
7054 constructor ( ) {
71- super ( "SDK not configured. Please call `configureSDK` before using." ) ;
72- this . name = "SdkNotConfiguredError" ;
73-
74- if ( Error . captureStackTrace ) {
75- Error . captureStackTrace ( this , this . constructor ) ;
76- }
55+ super ( "SdkNotConfiguredError" , "SDK not configured. Please call `configureSDK` before using." ) ;
7756 }
7857}
0 commit comments