refactor: use TypeError instead of generic Error when appropriate (#39209)

refactor: use TypeError instead of generic Error when appropriate
This commit is contained in:
Milan Burda 2023-07-25 18:08:46 +02:00 committed by GitHub
parent 77cc1d6ffa
commit 455f57322f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 13 deletions

View file

@ -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 {