Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit d3f9487

Browse files
committed
Rename, better error handling
1 parent 1d39015 commit d3f9487

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/cli/lib/interactive-login/complete-interactive-login.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const completeInteractiveLogin = async (
1919
spinner = ora.default("Logging in...")
2020
}
2121

22-
let submit_props: any
22+
let submit_args: any
2323
while (true) {
2424
console.clear()
2525

@@ -29,14 +29,18 @@ const completeInteractiveLogin = async (
2929
"/internal/connect_webviews/login/next",
3030
{
3131
connect_webview_id: connectWebviewId,
32-
submit_props,
32+
submit_args,
3333
}
3434
)
3535
spinner?.stop()
3636

3737
const currentPane = data.pane
3838

3939
if (currentPane.name === "finished_pane") {
40+
if (currentPane.render_props.error_msg) {
41+
throw new Error(currentPane.render_props.error_msg)
42+
}
43+
4044
break
4145
}
4246

@@ -49,7 +53,7 @@ const completeInteractiveLogin = async (
4953
console.error(formatErrorMsg(currentPane.render_props.error_msg))
5054
}
5155

52-
submit_props = await handler.getInput(currentPane.render_props)
56+
submit_args = await handler.getInput(currentPane.render_props)
5357
} catch (error) {
5458
if (spinner) {
5559
spinner.fail((error as Error).message)

0 commit comments

Comments
 (0)