Error boundaries
This commit is contained in:
@ -26,7 +26,9 @@ export function getBroadcasts(){
|
||||
xhr: xhr,
|
||||
status: status,
|
||||
error: error
|
||||
}
|
||||
},
|
||||
null,
|
||||
false
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -43,12 +45,13 @@ export function startSearch(search_type, query, only_mopidy = false){
|
||||
}
|
||||
}
|
||||
|
||||
export function handleException(message, data = {}, description = null){
|
||||
export function handleException(message, data = {}, description = null, show_notification = true){
|
||||
return {
|
||||
type: 'HANDLE_EXCEPTION',
|
||||
message: message,
|
||||
description: description,
|
||||
data: data
|
||||
data: data,
|
||||
show_notification: show_notification
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -71,18 +71,6 @@ const CoreMiddleware = (function(){
|
||||
}
|
||||
);
|
||||
|
||||
// Log with Raven Sentry
|
||||
/*
|
||||
if (store.getState().ui.allow_reporting){
|
||||
Raven.captureException(
|
||||
new Error(message),
|
||||
{
|
||||
extra: data
|
||||
}
|
||||
);
|
||||
}
|
||||
*/
|
||||
|
||||
// Log with Analytics
|
||||
if (store.getState().ui.allow_reporting){
|
||||
ReactGA.event({
|
||||
@ -93,8 +81,12 @@ const CoreMiddleware = (function(){
|
||||
});
|
||||
}
|
||||
|
||||
store.dispatch(uiActions.createNotification({content: message, type: 'bad', description: description}));
|
||||
if (action.show_notification){
|
||||
store.dispatch(uiActions.createNotification({content: message, type: 'bad', description: description}));
|
||||
}
|
||||
|
||||
console.error(message, description, data);
|
||||
|
||||
break;
|
||||
|
||||
case 'PLAY_PLAYLIST':
|
||||
|
||||
Reference in New Issue
Block a user