-
Couldn't load subscription status.
- Fork 109
Description
I saw another person raise this issue but it was closed, so I am going to try to explain this a bit differently.
The file connection.ts uses a Queue system and when an error is thrown (e.g. here), the original context of the stack trace is lost. This makes not useful for debugging, I'll include examples below.
To demonstrate this, I added this line to the top of the request method.
const originalStack = new Error().stackThen later just before this the line where reject(new ArangoError(res)); is called, I do this:
console.error('Original stack', originalStack)Now, in the console I print the final thrown error in my application, and you can also see the original stack trace in the console.
See how the original stack trace is my application code, and the error thrown by the arango connection library has no context related to my application?
Anyway, I am not sure what to do about this because I am sure the queue is useful, and also creating errors and saving stack traces is expensive and slow... But this makes things very very difficult to debug when the original context of the call is lost when an error is thrown.
