scramjetorg / scramjet

Public tracker for Scramjet Cloud Platform, a platform that bring data from many environments together.
https://www.scramjet.org
MIT License
253 stars 20 forks source link

Cant read remote file. UnhandledPromiseRejectionWarning: Error: Trailing quote on quoted field is malformed #84

Closed rendomnet closed 4 years ago

rendomnet commented 4 years ago

Describe the bug Showing error

To Reproduce

request
  .get("https://storage.cloud.google.com/***/some.csv") 
  .pipe(new StringStream()) 
  .CSVParse() // parse into objects
  .consume((object) => console.log("Row:", object)) 
  .then(() => console.log("all done"));

Error (node:5521) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 336) (node:5521) UnhandledPromiseRejectionWarning: Error: Trailing quote on quoted field is malformed at /node_modules/scramjet-core/lib/util/promise-transform-stream.js:230:31 at processTicksAndRejections (internal/process/task_queues.js:89:5) caused by: at Object.chunk (/node_modules/scramjet/lib/string-stream.js:57:52)

System:

rendomnet commented 4 years ago

Okay I found the problem. For google cloud I need to use different url. https://storage.googleapis.com/***/some.csv

But maybe error should be more help full

MichalCz commented 4 years ago

You know what they say: best issues solve themselves. :D

BTW, for better error handling just add a catch(err => console.error(err)) at the end.