@dile/crud 2.8.1 → 2.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -107,6 +107,7 @@ export class DileAjax extends DileAxios(DileI18nMixin(LitElement)) {
107
107
  }
108
108
  }
109
109
  this.dispatchResponse(res);
110
+ this.dispatchRawError(err, res);
110
111
 
111
112
  const status = res.status;
112
113
  switch (status) {
@@ -144,6 +145,7 @@ export class DileAjax extends DileAxios(DileI18nMixin(LitElement)) {
144
145
  this.dispatchError(res.data.message || this.translations.http_other_error, res.data);
145
146
  }
146
147
  } else {
148
+ this.dispatchRawError(err, null);
147
149
  this.dispatchError(this.translations.http_no_response, {});
148
150
  }
149
151
  }
@@ -158,6 +160,18 @@ export class DileAjax extends DileAxios(DileI18nMixin(LitElement)) {
158
160
  }));
159
161
  }
160
162
 
163
+ dispatchRawError(error, response = null) {
164
+ this.dispatchEvent(new CustomEvent('dile-ajax-raw-error', {
165
+ bubbles: true,
166
+ composed: true,
167
+ detail: {
168
+ error,
169
+ response,
170
+ status: response?.status || null,
171
+ }
172
+ }));
173
+ }
174
+
161
175
  dispatchResponse(response) {
162
176
  this.dispatchEvent(new CustomEvent('ajax-response', {
163
177
  bubbles: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dile/crud",
3
- "version": "2.8.1",
3
+ "version": "2.8.3",
4
4
  "description": "Components to create a generic crud system based on Web Components and Lit",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -25,12 +25,12 @@
25
25
  },
26
26
  "homepage": "https://dile-components.com/",
27
27
  "dependencies": {
28
- "@dile/ui": "^3.12.4",
28
+ "@dile/ui": "^3.12.5",
29
29
  "axios": "^1.19.0",
30
30
  "lit": "^2.7.0 || ^3.0.0"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "a6cf598429db0f791f20a77f64ae14f10d42cf56"
35
+ "gitHead": "b2be5f61d8a9e1c9e4048e93a598fd150adda529"
36
36
  }