-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include stack trace in errors, Closes #5660 #5758
base: main
Are you sure you want to change the base?
Conversation
Thank you @nicodecleyre, we'll have a look at it ASAP! |
How can we test how this works @nicodecleyre? |
I thought of: On the one hand by stubbing the |
I meant more: how can we see it in action. Stubs and mocks are based on assumptions, but how can we confirm that these are correct? How can we use CLI to see how it's handled in practice? |
Got it, during testing I deliberately entered an incorrect command. For this I have used |
Thanks! I'll try that! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the returned exception, it's not really useful:
Error: AxiosError: Request failed with status code 400
at settle (file:///Users/waldek/github/pnp/cli-microsoft365/node_modules/axios/lib/core/settle.js:19:12)
at IncomingMessage.handleStreamEnd (file:///Users/waldek/github/pnp/cli-microsoft365/node_modules/axios/lib/adapters/http.js:589:11)
at IncomingMessage.emit (node:events:530:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
at Axios.request (file:///Users/waldek/github/pnp/cli-microsoft365/node_modules/axios/lib/core/Axios.js:45:41)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
The whole stack points to code that we don't own and which we can do nothing about. I suggest we keep looking for another solution which is more helpful.
Hey @nicodecleyre, are you still working on this? |
Hi @waldekmastykarz, I certainly am. I've done some research regarding another solution in every spare time I have, just haven't found it yet |
Hi @waldekmastykarz, I investigated this further but the stacktrace has no reference to the cli code files at any time, not even in the command.action. I was wondering if we can formulate a solid solution to this question? |
Thanks for looking into it @nicodecleyre. I wonder if it would help, if we caught exceptions in the CLI code and threw a new one, so that we can capture information from the CLI code which we control rather than the dependencies with which we can do nothing. |
A-Mazing, this could go through with it, throwing an error from |
This looks way more meaningful! I'll have a closer look at it asap. Great find! 🚀 |
While working on this, i could not get the trace errors higher then the
handleRejectedODataPromise
& thehandleRejectedODataPromise
functions. For the tests i had to stub the cli options 🤔 , don't know if there is another, better wayCloses #5660