Skip to content

Commit 37d3cfd

Browse files
authored
chore: add timeout to ensure error flushes to stdout/err on auth failure (#589)
## Problem No log output for initializeAuth failure ## Solution Add a timeout before process kill to ensure the buffer flushes Tested locally by directly modifying the prod artifact. Note that the webpacked version appears to only output to `stdout` (instead of `stderr`, which should be expected with a `console.error` <!--- REMINDER: - Read CONTRIBUTING.md first. - Add test coverage for your changes. - Link to related issues/commits. - Testing: how did you test your changes? - Screenshots if applicable --> ## License By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 28ee764 commit 37d3cfd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

runtimes/runtimes/standalone.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ export const standalone = (props: RuntimeProps) => {
200200
},
201201
error => {
202202
console.error(error)
203-
process.exit(10)
203+
// arbitrary 5 second timeout to ensure console.error flushes before process exit
204+
// note: webpacked version may output exclusively to stdout, not stderr.
205+
setTimeout(() => {
206+
process.exit(10)
207+
}, 5000)
204208
}
205209
)
206210
.catch((error: Error) => {

0 commit comments

Comments
 (0)