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
|
@ -13,7 +13,7 @@ Object.defineProperty(WebFrameMain.prototype, 'ipc', {
|
|||
|
||||
WebFrameMain.prototype.send = function (channel, ...args) {
|
||||
if (typeof channel !== 'string') {
|
||||
throw new Error('Missing required channel argument');
|
||||
throw new TypeError('Missing required channel argument');
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -25,7 +25,7 @@ WebFrameMain.prototype.send = function (channel, ...args) {
|
|||
|
||||
WebFrameMain.prototype._sendInternal = function (channel, ...args) {
|
||||
if (typeof channel !== 'string') {
|
||||
throw new Error('Missing required channel argument');
|
||||
throw new TypeError('Missing required channel argument');
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue