Skip to content

Commit 08910d0

Browse files
authored
refactor: unify assert error messages for terminal API (#568)
1 parent 425651e commit 08910d0

File tree

1 file changed

+4
-4
lines changed
  • packages/library/src/server/applications/terminal

1 file changed

+4
-4
lines changed

packages/library/src/server/applications/terminal/api.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export async function initializeStdout(
5757
export async function sendStdin(options: { tabId: TabId; data: string }): Promise<void> {
5858
const tabId = options.tabId.tabId
5959
const app = terminals.get(tabId)
60-
assert(app !== undefined, `Terminal instance for clientId not found - cannot send stdin. Maybe it's not started yet?`)
60+
assert(app !== undefined, `Terminal instance for tabId not found - cannot send stdin. Maybe it's not started yet?`)
6161
assert(
6262
app.application,
6363
`Terminal application not found for client id ${options.tabId.tabId}. Maybe it's not started yet?`
@@ -73,11 +73,11 @@ export async function runBlockingShellCommand(
7373
): Promise<BlockingShellCommandOutput> {
7474
const tabId = input.tabId.tabId
7575
const app = terminals.get(tabId)
76-
assert(app !== undefined, `Terminal instance for clientId not found - cannot send stdin. Maybe it's not started yet?`)
7776
assert(
78-
app.application,
79-
`Terminal application not found for client id ${input.tabId.tabId}. Maybe it's not started yet?`
77+
app !== undefined,
78+
`Terminal instance for tabId ${input.tabId.tabId} not found - cannot send stdin. Maybe it's not started yet?`
8079
)
80+
assert(app.application, `Terminal application not found for tabId ${input.tabId.tabId}. Maybe it's not started yet?`)
8181

8282
const testDirectory = app.state?.testDirectory
8383
assert(testDirectory, `Test directory not found for client id ${input.tabId.tabId}. Maybe neovim's not started yet?`)

0 commit comments

Comments
 (0)