-
Notifications
You must be signed in to change notification settings - Fork 634
Closed
Labels
p2This is a standard priority issueThis is a standard priority issueservice-apiThis issue is due to a problem in a service API, not the SDK implementation.This issue is due to a problem in a service API, not the SDK implementation.wontfixWe have determined that we will not resolve the issue.We have determined that we will not resolve the issue.
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
In lightsail-client, when GetStaticIpCommand
and GetInstanceCommand
don't find the resource, they throw LightsailServiceException
but according to the docs for GetStaticIpCommand and GetInstanceCommand, they should throw NotFoundException
and the current behaviour makes instanceof
useless for checking type of the exception at runtime because LightsailServiceException
is the base exception. Unfortunately, I must resort to checking by the the name
property.
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.9.0
Reproduction Steps
import { LightsailClient, GetInstanceCommand, GetStaticIpCommand, NotFoundException, LightsailServiceException} from "@aws-sdk/client-lightsail";
const client = new LightsailClient({});
try{
await client.send(new GetInstanceCommand({instanceName: "non-existent instance"}));
}
catch(e){
if(e instanceof NotFoundException)
console.log("NotFoundException")
else if(e instanceof LightsailServiceException)
console.log("LightsailServiceException");
}
try{
await client.send(new GetStaticIpCommand({staticIpName: "non-existent static ip"}));
}
catch(e){
if(e instanceof NotFoundException)
console.log("NotFoundException")
else if(e instanceof LightsailServiceException)
console.log("LightsailServiceException");
}
Observed Behavior
The code outputs:
LightsailServiceException
LightsailServiceException
Expected Behavior
I expect to see:
NotFoundException
NotFoundException
Possible Solution
No response
Additional Information/Context
No response
Metadata
Metadata
Assignees
Labels
p2This is a standard priority issueThis is a standard priority issueservice-apiThis issue is due to a problem in a service API, not the SDK implementation.This issue is due to a problem in a service API, not the SDK implementation.wontfixWe have determined that we will not resolve the issue.We have determined that we will not resolve the issue.