From 4ac08870d07bb81e6b2103212f335d164a45ec35 Mon Sep 17 00:00:00 2001 From: Sergey Bekrin Date: Wed, 30 Mar 2016 23:07:13 +0300 Subject: [PATCH] Tweak error messages for dialog API --- lib/browser/api/dialog.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/browser/api/dialog.js b/lib/browser/api/dialog.js index 3a9d12006274..72ad4ea35179 100644 --- a/lib/browser/api/dialog.js +++ b/lib/browser/api/dialog.js @@ -56,7 +56,7 @@ module.exports = { options.properties = ['openFile']; } if (!Array.isArray(options.properties)) { - throw new TypeError('Properties need to be array'); + throw new TypeError('Properties must be an array'); } properties = 0; for (prop in fileDialogProperties) { @@ -68,12 +68,12 @@ module.exports = { if (options.title == null) { options.title = ''; } else if (typeof options.title !== 'string') { - throw new TypeError('Title need to be string'); + throw new TypeError('Title must be a string'); } if (options.defaultPath == null) { options.defaultPath = ''; } else if (typeof options.defaultPath !== 'string') { - throw new TypeError('Default path need to be string'); + throw new TypeError('Default path must be a string'); } if (options.filters == null) { options.filters = []; @@ -96,12 +96,12 @@ module.exports = { if (options.title == null) { options.title = ''; } else if (typeof options.title !== 'string') { - throw new TypeError('Title need to be string'); + throw new TypeError('Title must be a string'); } if (options.defaultPath == null) { options.defaultPath = ''; } else if (typeof options.defaultPath !== 'string') { - throw new TypeError('Default path need to be string'); + throw new TypeError('Default path must be a string'); } if (options.filters == null) { options.filters = []; @@ -129,22 +129,22 @@ module.exports = { throw new TypeError('Invalid message box type'); } if (!Array.isArray(options.buttons)) { - throw new TypeError('Buttons need to be array'); + throw new TypeError('Buttons must be an array'); } if (options.title == null) { options.title = ''; } else if (typeof options.title !== 'string') { - throw new TypeError('Title need to be string'); + throw new TypeError('Title must be a string'); } if (options.message == null) { options.message = ''; } else if (typeof options.message !== 'string') { - throw new TypeError('Message need to be string'); + throw new TypeError('Message must be a string'); } if (options.detail == null) { options.detail = ''; } else if (typeof options.detail !== 'string') { - throw new TypeError('Detail need to be string'); + throw new TypeError('Detail must be a string'); } if (options.icon == null) { options.icon = null;