From e853e636d41f97ddf137f1de36b997965dab2ad9 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com> Date: Tue, 26 Sep 2023 17:41:54 +0200 Subject: [PATCH] refactor: use common debugError (#11039) --- packages/puppeteer-core/src/bidi/Browser.ts | 2 +- packages/puppeteer-core/src/bidi/BrowsingContext.ts | 2 +- packages/puppeteer-core/src/bidi/Connection.ts | 2 +- packages/puppeteer-core/src/bidi/ExposedFunction.ts | 2 +- packages/puppeteer-core/src/bidi/util.ts | 8 +------- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/puppeteer-core/src/bidi/Browser.ts b/packages/puppeteer-core/src/bidi/Browser.ts index b331b0cb..ae057d19 100644 --- a/packages/puppeteer-core/src/bidi/Browser.ts +++ b/packages/puppeteer-core/src/bidi/Browser.ts @@ -28,6 +28,7 @@ import {BrowserContextEvent} from '../api/BrowserContext.js'; import {type Page} from '../api/Page.js'; import {type Target} from '../api/Target.js'; import {type Handler} from '../common/EventEmitter.js'; +import {debugError} from '../common/util.js'; import {type Viewport} from '../common/Viewport.js'; import {BidiBrowserContext} from './BrowserContext.js'; @@ -39,7 +40,6 @@ import { BiDiPageTarget, type BidiTarget, } from './Target.js'; -import {debugError} from './util.js'; /** * @internal diff --git a/packages/puppeteer-core/src/bidi/BrowsingContext.ts b/packages/puppeteer-core/src/bidi/BrowsingContext.ts index c5bdb136..350ef486 100644 --- a/packages/puppeteer-core/src/bidi/BrowsingContext.ts +++ b/packages/puppeteer-core/src/bidi/BrowsingContext.ts @@ -6,12 +6,12 @@ import {type Connection as CdpConnection} from '../cdp/Connection.js'; import {type PuppeteerLifeCycleEvent} from '../cdp/LifecycleWatcher.js'; import {TargetCloseError} from '../common/Errors.js'; import {type EventType} from '../common/EventEmitter.js'; +import {debugError} from '../common/util.js'; import {assert} from '../util/assert.js'; import {Deferred} from '../util/Deferred.js'; import {type BidiConnection} from './Connection.js'; import {BidiRealm} from './Realm.js'; -import {debugError} from './util.js'; /** * @internal diff --git a/packages/puppeteer-core/src/bidi/Connection.ts b/packages/puppeteer-core/src/bidi/Connection.ts index 44c821f3..32ccd0ab 100644 --- a/packages/puppeteer-core/src/bidi/Connection.ts +++ b/packages/puppeteer-core/src/bidi/Connection.ts @@ -20,9 +20,9 @@ import {CallbackRegistry} from '../cdp/Connection.js'; import {type ConnectionTransport} from '../common/ConnectionTransport.js'; import {debug} from '../common/Debug.js'; import {EventEmitter} from '../common/EventEmitter.js'; +import {debugError} from '../common/util.js'; import {type BrowsingContext, cdpSessions} from './BrowsingContext.js'; -import {debugError} from './util.js'; const debugProtocolSend = debug('puppeteer:webDriverBiDi:SEND ►'); const debugProtocolReceive = debug('puppeteer:webDriverBiDi:RECV ◀'); diff --git a/packages/puppeteer-core/src/bidi/ExposedFunction.ts b/packages/puppeteer-core/src/bidi/ExposedFunction.ts index 46abe288..a3fb75b8 100644 --- a/packages/puppeteer-core/src/bidi/ExposedFunction.ts +++ b/packages/puppeteer-core/src/bidi/ExposedFunction.ts @@ -17,6 +17,7 @@ import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import {type Awaitable, type FlattenHandle} from '../common/types.js'; +import {debugError} from '../common/util.js'; import {assert} from '../util/assert.js'; import {Deferred} from '../util/Deferred.js'; import {interpolateFunction, stringifyFunction} from '../util/Function.js'; @@ -24,7 +25,6 @@ import {interpolateFunction, stringifyFunction} from '../util/Function.js'; import {type BidiConnection} from './Connection.js'; import {type BidiFrame} from './Frame.js'; import {BidiSerializer} from './Serializer.js'; -import {debugError} from './util.js'; type SendArgsChannel = (value: [id: number, args: Args]) => void; type SendResolveChannel = ( diff --git a/packages/puppeteer-core/src/bidi/util.ts b/packages/puppeteer-core/src/bidi/util.ts index a7e94ad7..25936f81 100644 --- a/packages/puppeteer-core/src/bidi/util.ts +++ b/packages/puppeteer-core/src/bidi/util.ts @@ -16,17 +16,11 @@ import type * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; -import {debug} from '../common/Debug.js'; -import {PuppeteerURL} from '../common/util.js'; +import {PuppeteerURL, debugError} from '../common/util.js'; import {type BidiRealm} from './Realm.js'; import {BidiSerializer} from './Serializer.js'; -/** - * @internal - */ -export const debugError = debug('puppeteer:error'); - /** * @internal */