exception thrown outside of main thread when upload fails
See original GitHub issue- Is this a client library issue or a product issue?
client issue - @google-cloud/storage@6.2.3
-
Did someone already solve this? no but it’s very similar to https://github.com/googleapis/nodejs-storage/issues/1968, perhaps the same solution can be applied here?
-
Do you have a support contract? no
Environment details
- OS: linux
- Node.js version: 16.x
- npm version: 8.5.5
@google-cloud/storage
version: 6.2.3
Steps to reproduce
unfortunately i can’t reliably reproduce it but sometimes we get errors that can’t be caught.
our code:
try {
await storage.bucket(bucket).file(file).save(data, { resumable: false })
} catch(error) {
// do something here
}
the stack trace
/usr/src/app/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js in new ApiError at line 79:15
/usr/src/app/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js in Util.parseHttpRespBody at line 214:38
/usr/src/app/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js in Util.handleResp at line 155:117
/usr/src/app/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js in <anonymous> at line 535:22
/usr/src/app/node_modules/retry-request/index.js in onResponse at line 240:7
/usr/src/app/node_modules/teeny-request/build/src/index.js in <anonymous> at line 157:17
/usr/src/app/node_modules/@google-cloud/storage/build/src/nodejs-common/util.js in runMicrotasks
node:internal/process/task_queues in processTicksAndRejections at line 96:5
and the associated network request:
POST https://storage.googleapis.com/upload/storage/v1/b/BUCKET/o?uploadType=multipart&name=FILENAME [503]
we’ve seen this ~20 times today
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
can't catch exception in main thread when other ...
It's not so much that the exception isn't caught as it is that destroying a joinable thread terminates the process.
Read more >Thread.UncaughtExceptionHandler | by Yosi Mizrachi
Today I want to talk about Java's Thread. ... Exception in thread “main” java.lang. ... System.out.println("Failed to divide by zero.");
Read more >C++ exceptions on iOS | Apple Developer Forums
When C++ exceptions are thrown on the main thread, they are caught by a CFRunLoop exception handler and rethrown, which destroys all the...
Read more >How to Fix the FileNotFoundException in Java.io
The FileNotFoundException is a checked exception in Java that occurs when an attempt to open a file denoted by a specified pathname fails....
Read more >Upload component throws an exception · Issue #702
Thread.run(Thread.java:745) Caused by: java.lang.IllegalStateException: Upload cannot be performed without a receiver set at com.vaadin.ui.Upload$2.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ddelgrosso1 thanks for the suggestion, we’re adding that option now.
Thank you for the update @modosc.