Tweak error messages for dialog API
This commit is contained in:
parent
7f78781800
commit
4ac08870d0
1 changed files with 9 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue