diff --git a/lib/gui/app/app.js b/lib/gui/app/app.js index d30002f8..fa37bf61 100644 --- a/lib/gui/app/app.js +++ b/lib/gui/app/app.js @@ -37,6 +37,7 @@ const analytics = require('./modules/analytics') const availableDrives = require('./models/available-drives') const driveScanner = require('./modules/drive-scanner') const osDialog = require('./os/dialog') +// eslint-disable-next-line node/no-missing-require const exceptionReporter = require('./modules/exception-reporter') // eslint-disable-next-line node/no-missing-require const { updateLock } = require('./modules/update-lock') diff --git a/lib/gui/app/modules/exception-reporter.js b/lib/gui/app/modules/exception-reporter.ts similarity index 59% rename from lib/gui/app/modules/exception-reporter.js rename to lib/gui/app/modules/exception-reporter.ts index b2a61dd0..641141a9 100644 --- a/lib/gui/app/modules/exception-reporter.js +++ b/lib/gui/app/modules/exception-reporter.ts @@ -14,27 +14,16 @@ * limitations under the License. */ -'use strict' - -const _ = require('lodash') -const analytics = require('../modules/analytics') -const osDialog = require('../os/dialog') +import { logException } from '../modules/analytics'; +import { showError } from '../os/dialog'; /** * @summary Report an exception - * @function - * @public - * - * @param {Error} exception - exception - * - * @example - * exceptionReporter.report(new Error('Something happened')); */ -exports.report = (exception) => { - if (_.isUndefined(exception)) { - return - } - - osDialog.showError(exception) - analytics.logException(exception) +export function report(exception?: Error) { + if (exception === undefined) { + return; + } + showError(exception); + logException(exception); }