mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 11:16:39 +00:00
Prevent dialog.showErrorBox() throwing if wrong parameters (#274)
If the function lacks a message or a title, the following error is thrown: Error: Could not call remote function ``. Check that the function signature is correct. Underlying error: Error processing argument at index 0, conversion failure from undefined Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
parent
5ccc6b6aa4
commit
c2265c6561
@ -82,6 +82,7 @@ exports.selectImage = function() {
|
|||||||
* dialog.showError(new Error('Foo Bar'));
|
* dialog.showError(new Error('Foo Bar'));
|
||||||
*/
|
*/
|
||||||
exports.showError = function(error) {
|
exports.showError = function(error) {
|
||||||
electron.dialog.showErrorBox(error.message, error.stack || '');
|
error = error || {};
|
||||||
|
electron.dialog.showErrorBox(error.message || 'An error ocurred!', error.stack || '');
|
||||||
throw error;
|
throw error;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user