Closed Rambatino closed 4 years ago
Hello, I'm getting:
An unexpected error occured. TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be one of type string or Buffer. Received type object
I've obviously set up something wrong, but it's squashing the error.
I imagine it's because 'e' here is an object, when really we require a string (or buffer).
Is it possible to add a JSON.stringify(e) into the stderr write?
let postResult: Response; try { let postUrl = `${request.source.server_url}`; if (request.params.force) { postUrl += "?force=true" } postResult = await fetch(postUrl, { method: "POST", headers: headers, body: body }); } catch (e) { process.stderr.write(`Upload of chart file to "${request.source.server_url}" has failed.\n`); process.stderr.write(e); process.exit(124); throw e; // Tricking the typescript compiler. }
You are right. I'll replace the various bogus portions of the code where objects are thrown to stderr without any further checking.
Duplicat of #7
Hello, I'm getting:
I've obviously set up something wrong, but it's squashing the error.
I imagine it's because 'e' here is an object, when really we require a string (or buffer).
Is it possible to add a JSON.stringify(e) into the stderr write?