scaleway / serverless-scaleway-functions

Plugin for Serverless Framework to allow users to deploy their serverless applications on Scaleway Functions
MIT License
78 stars 25 forks source link

Receiving an error to a function invoke raises an exception #147

Closed Cubox closed 1 year ago

Cubox commented 1 year ago
✖ Uncaught exception
/Users/a/a/scaleway-scheduler/node_modules/serverless/scripts/serverless.js:53
        throw error;
        ^

TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of AxiosError
    at new NodeError (node:internal/errors:399:5)
    at _write (node:internal/streams/writable:315:13)
    at Writable.write (node:internal/streams/writable:337:10)
    at WriteStream.<anonymous> (/Users/a/a/a/node_modules/cli-progress-footer/lib/private/cli-progress-footer/override-std-props.js:56:5)
    at stream.write (/Users/a/a/a/node_modules/process-utils/lib/private/get-override-stream-write.js:12:54)
    at /Users/a/a/a/node_modules/serverless-scaleway-functions/invoke/scalewayInvoke.js:65:24
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Switching line 65 of scalewayInvoke.js to process.stderr.write(error.toString()); will return the error (which was a 403 in my situation).

thomas-tacquet commented 1 year ago

Thank you for the detailed report ! Fixed and tested, once merged I will release it in the v0.4.6 version 👌