# disk-usage-insights/1.6/res/js/htmx-custom-error-handler.js

Disk Usage Insights, version 1.6. 10 lines.

- Page: https://pluginprobe.com/plugins/disk-usage-insights/1.6/code/res/js/htmx-custom-error-handler.js
- Raw: https://pluginprobe.com/plugins/disk-usage-insights/1.6/raw/res/js/htmx-custom-error-handler.js
- Modified: 2025-04-08T13:02:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/disk-usage-insights/1.6/code/res/js/htmx-custom-error-handler.js#L10-L20`.

```javascript
htmx.on('htmx:responseError', function (evt) {
    // 403=Forbidden
    console.log(evt.detail.xhr.response);
    console.log(evt.detail.xhr.responseText);
    alert('Received error from server (code=' + evt.detail.xhr.status + ') - see console');
});
htmx.on('htmx:sendError', function (evt) {
    alert('Could not send data to server');
});

```
