> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goshippo.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.goshippo.com/feedback

```json
{
  "path": "/docs/ShippingElements/errors",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Error and Debugging

> Handle errors and debug issues in Shippo Shipping Elements using event listeners and the onAny logging method.

## Errors

All errors coming from the Shipping Elements can be accessing using an event listener on the `ERROR` event documented in [Events](/docs/ShippingElements/events). For example:

```javascript theme={null}
shippo.on('ERROR', (error) => {
    switch (error.code) {
      case 'UNAUTHORIZED':
          // The authentication token is malformed, expired or otherwise invalid.
          break;
      case 'LABEL_PURCHASE_ERROR':
        // An error occurred during label purchase
        break;
      case 'COUNTRY_NOT_SUPPORTED':
        // To or from address country is not supported
        break;
      case 'LOCALE_NOT_SUPPORTED':
        // Locale passed in the init function is not supported
        break;
      case 'UNKNOWN':
        // An unknown error happened
        break;
    }
});
```

## Debugging

You can use the various [event handlers](/docs/ShippingElements/events) to help debug the application. There is also a special `onAny()` method that will handle any events from Shippo Shipping Elements:

```javascript theme={null}
shippo.onAny((params) => {
  // Log any events thrown from Shippo Shipping Elements
  console.log(params);
});
```
