MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / getBackendErrorRootCause

Function getBackendErrorRootCause

pkg/webui/lib/errors/utils.js:442–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440 * @returns {object} - The root cause of `error`.
441 */
442export const getBackendErrorRootCause = error => {
443 let rootCause
444 if (hasCauses(error)) {
445 rootCause = error.cause
446 } else {
447 rootCause = getBackendErrorDetails(error)
448 }
449
450 while ('cause' in rootCause) {
451 rootCause = rootCause.cause
452 }
453
454 return rootCause
455}
456
457/**
458 * Returns the attributes of the backend error message, if any.

Callers 3

getSentryErrorTitleFunction · 0.85
toMessagePropsFunction · 0.85

Calls 2

hasCausesFunction · 0.85
getBackendErrorDetailsFunction · 0.85

Tested by

no test coverage detected