Skip to content

Commit 56aa00d

Browse files
committed
ts issue, log errors even if err.stderr/stdout is null
1 parent f623a2c commit 56aa00d

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

tooling/v8-snapshot/src/generator/snapshot-generator.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ export class SnapshotGenerator {
327327
}
328328
logDebug(
329329
Object.assign({}, result, {
330-
snapshotScript: `len: ${result.snapshotScript.length}`,
331-
bundle: `len: ${result.bundle.length}`,
330+
snapshotScript: `len: ${Buffer.byteLength(result.snapshotScript)} bytes`,
331+
bundle: `len: ${Buffer.byteLength(result.bundle)} bytes`,
332332
meta: '<hidden>',
333333
}),
334334
)
@@ -503,12 +503,16 @@ export class SnapshotGenerator {
503503

504504
return { v8ContextFile: this.v8ContextFile, snapshotBinDir: this.snapshotBinDir }
505505
} catch (err: any) {
506-
if (err.stderr != null) {
507-
logError(err.stderr.toString())
508-
}
509-
510-
if (err.stdout != null) {
511-
logDebug(err.stdout.toString())
506+
if (err.stderr || err.stdout) {
507+
if (err.stderr != null) {
508+
logError(err.stderr.toString())
509+
}
510+
511+
if (err.stdout != null) {
512+
logDebug(err.stdout.toString())
513+
}
514+
} else {
515+
logError(err.toString())
512516
}
513517

514518
// If things went wrong print instructions on how to execute the

0 commit comments

Comments
 (0)