refactor: use TypeError
instead of generic Error
when appropriate (#39209)
refactor: use TypeError instead of generic Error when appropriate
This commit is contained in:
parent
77cc1d6ffa
commit
455f57322f
9 changed files with 13 additions and 13 deletions
|
@ -331,7 +331,7 @@ class TouchBar extends EventEmitter implements Electron.TouchBar {
|
|||
const idSet = new Set();
|
||||
items.forEach((item) => {
|
||||
if (!(item instanceof TouchBarItem)) {
|
||||
throw new Error('Each item must be an instance of TouchBarItem');
|
||||
throw new TypeError('Each item must be an instance of TouchBarItem');
|
||||
}
|
||||
|
||||
if (item.type === 'other_items_proxy') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue