Adding Sentry/Raven for error tracking
This commit is contained in:
@ -32,7 +32,15 @@ export function startSearch(search_type, query, only_mopidy = false){
|
||||
}
|
||||
}
|
||||
|
||||
export function debugResponse( response ){
|
||||
export function handleException(message, data = {}){
|
||||
return {
|
||||
type: 'HANDLE_EXCEPTION',
|
||||
message: message,
|
||||
data: data
|
||||
}
|
||||
}
|
||||
|
||||
export function debugResponse(response){
|
||||
return {
|
||||
type: 'DEBUG',
|
||||
response: response
|
||||
|
||||
@ -18,6 +18,27 @@ const CoreMiddleware = (function(){
|
||||
|
||||
switch(action.type){
|
||||
|
||||
case 'HANDLE_EXCEPTION':
|
||||
var data = Object.assign(
|
||||
{},
|
||||
action.data,
|
||||
{
|
||||
state: store.getState()
|
||||
}
|
||||
);
|
||||
|
||||
Raven.captureException(
|
||||
new Error(action.message),
|
||||
{
|
||||
extra: data
|
||||
}
|
||||
);
|
||||
|
||||
store.dispatch(uiActions.createNotification(action.message,'bad'))
|
||||
|
||||
console.error(action.message, data);
|
||||
break;
|
||||
|
||||
case 'CORE_START_SERVICES':
|
||||
store.dispatch(mopidyActions.connect())
|
||||
store.dispatch(pusherActions.connect())
|
||||
|
||||
Reference in New Issue
Block a user