Skip to content

Commit

Permalink
Fix: Error Messages in HealthCheck (#2759)
Browse files Browse the repository at this point in the history
* Fix: Error Messages in HealthCheck

* Update sdk/package/lib/util/SubContainer.ts

Co-authored-by: Aiden McClelland <[email protected]>

* fix ts error

---------

Co-authored-by: Aiden McClelland <[email protected]>
Co-authored-by: Aiden McClelland <[email protected]>
  • Loading branch information
3 people authored Oct 21, 2024
1 parent 2fa0a57 commit 28e39c5
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions sdk/package/lib/util/SubContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,18 +258,12 @@ export class SubContainer implements ExecSpawnable {
await new Promise<null>((resolve) => child.stdin.end(resolve))
}
const pid = child.pid
const stdout = { data: "" as string | Buffer }
const stderr = { data: "" as string | Buffer }
const stdout = { data: "" as string }
const stderr = { data: "" as string }
const appendData =
(appendTo: { data: string | Buffer }) =>
(chunk: string | Buffer | any) => {
if (typeof appendTo.data === "string" && typeof chunk === "string") {
appendTo.data += chunk
} else if (typeof chunk === "string" || chunk instanceof Buffer) {
appendTo.data = Buffer.concat([
new Uint8Array(Buffer.from(appendTo.data).buffer),
new Uint8Array(Buffer.from(chunk).buffer),
])
(appendTo: { data: string }) => (chunk: string | Buffer | any) => {
if (typeof chunk === "string" || chunk instanceof Buffer) {
appendTo.data += chunk.toString()
} else {
console.error("received unexpected chunk", chunk)
}
Expand Down

0 comments on commit 28e39c5

Please sign in to comment.