Skip to content

Stack trace is not useful because of queue system loses context #599

@a-r-d

Description

@a-r-d

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().stack

Then 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?

screen shot 2019-02-15 at 3 05 08 pm

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.

Metadata

Metadata

Assignees

Labels

Feature RequestRequest for new functionality to be added to the driver.fixedIssue has been resolved but remains open due to a pending release.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions