Error Handling
Below is an example that implements basic error handling by catching and logging errors that may result from a failed action.
The error thrown by a failed action in the Aurora SDK extends the standard JavaScript Error class, and the message
property will have a human-readable error message.
// Importing Aurora ES Module and Loading a Design
const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
await sdk.cad.attach('#cad-element');
let design = await window.sdk.design.load('<design_id>');
// Run irradiance and log any errors
try {
await window.design.runIrradiance();
} catch (error) {
console.error(`Irradiance failed to run: ${error.message}`);
}
SDK Errors
These generic errors may occur during a number of async actions.
message | description |
---|---|
Your internet connection is unstable. Please check your network stability then retry. | Your network is experiencing a large amount of latency, Aurora services may take longer to respond as a result. |
| CAD state timed out | An unexpected error occurred during initialization, please ensure you have network connectivity, and try again. | | CAD not found | An unexpected error occurred during initialization, please refresh the page or reload the SDK | | CAD engine save function is not available | An unexpected error occurred during initialization, please refresh the page or reload the SDK | | CAD events stream not found | An unexpected error occurred during initialization, please refresh the page or reload the SDK | | CAD events stream context lost | An unexpected error occurred during initialization, please refresh the page or reload the SDK |
There are also more specific errors that occur during certain actions or when initializing the SDK: