@globalbrain/sefirot 4.43.1 → 4.43.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.
@@ -27,6 +27,7 @@ import {
27
27
  toValue
28
28
  } from 'vue'
29
29
  import { useError } from '../stores/Error'
30
+ import { getHttpStatusCode } from '../support/Http'
30
31
 
31
32
  export interface User {
32
33
  id?: string | number
@@ -214,7 +215,10 @@ export function useErrorHandler({
214
215
  userValue = null
215
216
  }
216
217
 
217
- if (![403, 404].includes(e?.cause?.statusCode)) {
218
+ const statusCode = getHttpStatusCode(e)
219
+ if (!statusCode || statusCode < 400 || statusCode >= 500) {
220
+ //
221
+
218
222
  const $ = instance && instance.$
219
223
  const metadata = $ && {
220
224
  componentName: formatComponentName($),
@@ -40,3 +40,24 @@ export function objectToFormData(
40
40
 
41
41
  return fd
42
42
  }
43
+
44
+ export function getHttpStatusCode(error: any): number | undefined {
45
+ const candidates = [
46
+ error?.status,
47
+ error?.statusCode,
48
+ error?.response?.status,
49
+ error?.response?.statusCode,
50
+ error?.error?.status,
51
+ error?.error?.statusCode,
52
+ error?.details?.status,
53
+ error?.details?.statusCode,
54
+ error?.cause?.status,
55
+ error?.cause?.statusCode,
56
+ error?.cause?.response?.status,
57
+ error?.cause?.response?.statusCode,
58
+ error?.code,
59
+ error?.cause?.code
60
+ ]
61
+
62
+ return candidates.map(Number).find((n) => Number.isInteger(n) && n >= 100 && n <= 599)
63
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
- "version": "4.43.1",
3
+ "version": "4.43.3",
4
4
  "description": "Vue Components for Global Brain Design System.",
5
5
  "keywords": [
6
6
  "components",