ELECTRON-508 - Change error and warn functions to prevent from exposing application path (#388)

This commit is contained in:
Kiran Niranjan 2018-06-06 15:42:01 +05:30 committed by Vishwas Shashidhar
parent 7ae769df7e
commit a54266a0ae
2 changed files with 15 additions and 13 deletions

View File

@ -186,7 +186,7 @@
} }
function snippetError(err) { function snippetError(err) {
alert('error getting snippet' + err); alert('error getting snippet' + err.message);
} }
}); });

View File

@ -166,24 +166,26 @@ function readResult(outputFileName, resolve, reject, childProcessErr) {
/* eslint-disable class-methods-use-this */ /* eslint-disable class-methods-use-this */
/** /**
* Create an error object with the ERROR level * Create an error object with the ERROR level
* @param msg * @param message
* @returns {Error} * @returns {{message: string, type: string}}
*/ */
function createError(msg) { function createError(message) {
let err = new Error(msg); return {
err.type = 'ERROR'; message,
return err; type: 'ERROR',
};
} }
/** /**
* Create an error object with the WARN level * Create an error object with the WARN level
* @param msg * @param message
* @returns {Error} * @returns {{message: string, type: string}}
*/ */
function createWarn(msg) { function createWarn(message) {
let err = new Error(msg); return {
err.type = 'WARN'; message,
return err; type: 'WARN',
};
} }
/* eslint-enable class-methods-use-this */ /* eslint-enable class-methods-use-this */