Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion driver/lib/sessions/observatory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export async function connectSocket(
// `await` is needed so that rejected promise will be thrown and caught
return await originalSocketCall.apply(socket, args);
} catch (e) {
this.log.errorAndThrow(JSON.stringify(e));
this.log.errorWithException(new Error(JSON.stringify(e)));
}
};
this.log.info(`Connecting to Dart Observatory: ${dartObservatoryURL}`);
Expand Down
18 changes: 11 additions & 7 deletions driver/lib/sessions/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { PLATFORM } from '../platform';
export const reConnectFlutterDriver = async function(this: FlutterDriver, caps: Record<string, any>) {
// setup proxies - if platformName is not empty, make it less case sensitive
if (!caps.platformName) {
this.log.errorAndThrow(`No platformName was given`);
this.log.errorWithException(new Error(`No platformName was given`));
}

switch (_.toLower(caps.platformName)) {
Expand All @@ -23,9 +23,11 @@ export const reConnectFlutterDriver = async function(this: FlutterDriver, caps:
this.socket = await connectAndroidSession.bind(this)(this.proxydriver, caps, true);
break;
default:
this.log.errorAndThrow(
`Unsupported platformName: ${caps.platformName}. ` +
`Only the following platforms are supported: ${_.keys(PLATFORM)}`
this.log.errorWithException(
new Error(
`Unsupported platformName: ${caps.platformName}. ` +
`Only the following platforms are supported: ${_.keys(PLATFORM)}`
)
);
}
};
Expand All @@ -48,9 +50,11 @@ export const createSession: any = async function(this: FlutterDriver, sessionId:
this.proxydriver.allowInsecure = this.allowInsecure;
break;
default:
this.log.errorAndThrow(
`Unsupported platformName: ${caps.platformName}. ` +
`Only the following platforms are supported: ${_.keys(PLATFORM)}`
this.log.errorWithException(
new Error(
`Unsupported platformName: ${caps.platformName}. ` +
`Only the following platforms are supported: ${_.keys(PLATFORM)}`
)
);
}

Expand Down
Loading