Convert exception-reporter.js to typescript

Change-type: patch
This commit is contained in:
Alexis Svinartchouk 2020-01-08 12:38:23 +01:00 committed by Lorenzo Alberto Maria Ambrosi
parent 596b316d65
commit fadfadd9e9
2 changed files with 9 additions and 19 deletions

View File

@ -37,6 +37,7 @@ const analytics = require('./modules/analytics')
const availableDrives = require('./models/available-drives') const availableDrives = require('./models/available-drives')
const driveScanner = require('./modules/drive-scanner') const driveScanner = require('./modules/drive-scanner')
const osDialog = require('./os/dialog') const osDialog = require('./os/dialog')
// eslint-disable-next-line node/no-missing-require
const exceptionReporter = require('./modules/exception-reporter') const exceptionReporter = require('./modules/exception-reporter')
// eslint-disable-next-line node/no-missing-require // eslint-disable-next-line node/no-missing-require
const { updateLock } = require('./modules/update-lock') const { updateLock } = require('./modules/update-lock')

View File

@ -14,27 +14,16 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict' import { logException } from '../modules/analytics';
import { showError } from '../os/dialog';
const _ = require('lodash')
const analytics = require('../modules/analytics')
const osDialog = require('../os/dialog')
/** /**
* @summary Report an exception * @summary Report an exception
* @function
* @public
*
* @param {Error} exception - exception
*
* @example
* exceptionReporter.report(new Error('Something happened'));
*/ */
exports.report = (exception) => { export function report(exception?: Error) {
if (_.isUndefined(exception)) { if (exception === undefined) {
return return;
} }
showError(exception);
osDialog.showError(exception) logException(exception);
analytics.logException(exception)
} }