From c9101d36f255f5eac130824d8a27dc44c954c136 Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Thu, 8 Oct 2020 21:07:16 +0100 Subject: [PATCH 1/2] Report showplan save failures to Raygun --- src/showplanner/state.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/showplanner/state.ts b/src/showplanner/state.ts index 44bdb97..fe08ccc 100644 --- a/src/showplanner/state.ts +++ b/src/showplanner/state.ts @@ -3,6 +3,7 @@ import * as api from "../api"; import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { AppThunk } from "../store"; import { cloneDeep } from "lodash"; +import raygun from "raygun4js"; export interface ItemGhost { type: "ghost"; @@ -320,6 +321,13 @@ export const moveItem = ( if (getState().settings.saveShowPlanChanges) { const result = await api.updateShowplan(timeslotid, ops); if (!result.every((x) => x.status)) { + raygun("send", { + error: new Error("Showplan update failure [moveItem]"), + customData: { + ops, + result + } + }); dispatch(showplan.actions.planSaveError("Failed to update show plan.")); return; } @@ -393,6 +401,13 @@ export const addItem = ( }); const result = await api.updateShowplan(timeslotId, ops); if (!result.every((x) => x.status)) { + raygun("send", { + error: new Error("Showplan update failure [addItem]"), + customData: { + ops, + result + } + }); dispatch(showplan.actions.planSaveError("Failed to update show plan.")); return; } @@ -449,6 +464,13 @@ export const removeItem = ( if (getState().settings.saveShowPlanChanges) { const result = await api.updateShowplan(timeslotId, ops); if (!result.every((x) => x.status)) { + raygun("send", { + error: new Error("Showplan update failure [removeItem]"), + customData: { + ops, + result + } + }); dispatch(showplan.actions.planSaveError("Failed to update show plan.")); return; } From 66067ca6472cafc54c143c6655c5c51689b1080b Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Thu, 8 Oct 2020 21:12:03 +0100 Subject: [PATCH 2/2] Make it look The Good --- src/showplanner/state.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/showplanner/state.ts b/src/showplanner/state.ts index fe08ccc..a077b5a 100644 --- a/src/showplanner/state.ts +++ b/src/showplanner/state.ts @@ -325,8 +325,8 @@ export const moveItem = ( error: new Error("Showplan update failure [moveItem]"), customData: { ops, - result - } + result, + }, }); dispatch(showplan.actions.planSaveError("Failed to update show plan.")); return; @@ -405,8 +405,8 @@ export const addItem = ( error: new Error("Showplan update failure [addItem]"), customData: { ops, - result - } + result, + }, }); dispatch(showplan.actions.planSaveError("Failed to update show plan.")); return; @@ -468,8 +468,8 @@ export const removeItem = ( error: new Error("Showplan update failure [removeItem]"), customData: { ops, - result - } + result, + }, }); dispatch(showplan.actions.planSaveError("Failed to update show plan.")); return;