There is no error handling logic in the sdk that I am currently making. So when an error occurs in the API call, the error message given by the API is just displayed to the user.
I think sdk needs backoff logic (error handling, retry, etc.) for user convenience.
So I'm looking at aws sdk. However, AWS sdk also seems to be simply creating an error object and displayed errors from the API.
According to my research, Forexample ...
// 1. When input invalidate accountId type.
var client = new AWS.S3Control().getPublicAccessBlock({AccountId : accountId}).build();
// 2. It occur error.
getPublicAccessBlock(params: ...params, callback?: (err: AWSError, data: ...data) => void): Request< ...data, AWSError>;
// 3. AWS sdk simply displayed error in AWSError object
export type AWSError = Error & {
code: string;
message: string;
retryable?: boolean;
statusCode?: number;
time: Date;
hostname?: string;
region?: string;
retryDelay?: number;
requestId?: string;
extendedRequestId?: string;
cfId?: string;
originalError?: Error
}
MyGoal is