MCPcopy Create free account
hub / github.com/linuxfoundation/crowd.dev / selectErrorKeyOrMessage

Function selectErrorKeyOrMessage

frontend/src/shared/error/errors.js:12–24  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

10);
11
12function selectErrorKeyOrMessage(error) {
13 if (error && error.response && error.response.data) {
14 const { data } = error.response;
15
16 if (data.error && data.error.message) {
17 return data.error.message;
18 }
19
20 return String(data);
21 }
22
23 return error.message || DEFAULT_ERROR_MESSAGE;
24}
25
26function selectErrorMessage(error) {
27 const key = selectErrorKeyOrMessage(error);

Callers 1

selectErrorMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected