nodejs-storage icon indicating copy to clipboard operation
nodejs-storage copied to clipboard

Unhandled Error in startResumableUpload_ Function

Open cuyl opened this issue 1 year ago • 0 comments

Cannot handle the error by try...catch nor writable.on('error')

Environment details

  • OS: All
  • Node.js version: All
  • npm version: All
  • @google-cloud/storage version: 7.11.2

Steps to reproduce

  1. partial upload without url provided
  2. run file.createWriteStream
const opitons = {
  offset: 1,
  isPartialUpload: true,
};
let writable;
try {
   writable = file.createWriteStream(opitons);
} catch (error) {
  // cannot catch the error
  return;
}

writable.on('error', (err: RangeError) => {
   // cannot catch the error
});

writable.write('data');

cuyl avatar Jul 05 '24 08:07 cuyl