MCPcopy Index your code
hub / github.com/Dispatcharr/Dispatcharr / errorNotification

Function errorNotification

frontend/src/api.js:25–51  ·  view source on GitHub ↗
(message, error)

Source from the content-addressed store, hash-verified

23 : '';
24
25const errorNotification = (message, error) => {
26 let errorMessage = '';
27
28 if (error.status) {
29 try {
30 // Try to format the error body if it's an object
31 if (typeof error.body === 'object') {
32 errorMessage = JSON.stringify(error.body, null, 2);
33 } else {
34 errorMessage = `${error.status} - ${error.body}`;
35 }
36 } catch (e) {
37 errorMessage = `${error.status} - ${String(error.body)}`;
38 }
39 } else {
40 errorMessage = error.message || 'Unknown error';
41 }
42
43 notifications.show({
44 title: 'Error',
45 message: `${message}: ${errorMessage}`,
46 autoClose: 10000,
47 color: 'red',
48 });
49
50 throw error;
51};
52
53const request = async (url, options = {}) => {
54 if (

Callers 15

createSuperUserMethod · 0.85
loginMethod · 0.85
getChannelsMethod · 0.85
getChannelsSummaryMethod · 0.85
repackGroupChannelsMethod · 0.85
queryChannelsMethod · 0.85
getChannelsForParamsMethod · 0.85
requeryChannelsMethod · 0.85
getAllChannelIdsMethod · 0.85
getChannelGroupsMethod · 0.85
addChannelGroupMethod · 0.85
updateChannelGroupMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected