pauseOnExceptions.js (1009B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ 4 5 const { 6 PROMISE, 7 } = require("resource://devtools/client/shared/redux/middleware/promise.js"); 8 import { recordEvent } from "../../utils/telemetry"; 9 10 /** 11 * 12 * @memberof actions/pause 13 * @static 14 */ 15 export function pauseOnExceptions( 16 shouldPauseOnExceptions, 17 shouldPauseOnCaughtExceptions 18 ) { 19 return ({ dispatch, client }) => { 20 recordEvent("pause_on_exceptions", { 21 exceptions: shouldPauseOnExceptions, 22 // There's no "n" in the key below (#1463117) 23 ["caught_exceptio"]: shouldPauseOnCaughtExceptions, 24 }); 25 26 return dispatch({ 27 type: "PAUSE_ON_EXCEPTIONS", 28 shouldPauseOnExceptions, 29 shouldPauseOnCaughtExceptions, 30 [PROMISE]: client.pauseOnExceptions( 31 shouldPauseOnExceptions, 32 shouldPauseOnCaughtExceptions 33 ), 34 }); 35 }; 36 }