-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
When the auth key is invalid the sdk throws a generic exception with non-informative error message which makes these kind of errors hard to catch.
Version: "shipengine": "^1.0.7",
Code example:
import { ShipEngine } from "shipengine";
const config = {
apiKey: "TEST",
}
const addresses = [
{
name: "John Smith",
companyName: "ShipStation",
addressLine1: "3800 N Lamar Blvd",
addressLine2: "#220",
cityLocality: "Austin",
stateProvince: "TX",
postalCode: "78756",
countryCode: "US",
addressResidentialIndicator: "no",
},
]
let shipengine = new ShipEngine(config);
const result = await shipengine.validateAddresses(addresses);
error message:
Error validating address: response.map is not a function
Error validating address: TypeError: response.map is not a function
at Object.formatResponse (<path>/node_modules/shipengine/cjs/validate-addresses/format-response.js:5:21)
at Object.validateAddresses (<path>/node_modules/shipengine/cjs/validate-addresses/index.js:19:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async validateAddresses (<path>/agent.js:20:20)
...
jakeaturner
Metadata
Metadata
Assignees
Labels
No labels