dartz icon indicating copy to clipboard operation
dartz copied to clipboard

[Feature request] Add `StackTrace` to `Task`

Open x1z7 opened this issue 5 years ago • 0 comments

Hey @spebbe 👋

I'd like to suggest adding the StackTrace to the left of a task invocation. So instead of:

@override Task<Either<Object, A>> attempt() => new Task(() => run().then(right).catchError((err) => left<Object, A>(err)));

you'd have:

@override Task<Either<TaskError, A>> attempt() => new Task(() => run().then(right).catchError((e, s) => left<TaskError, A>(TaskError(e, s))));

Where TaskError class would hold the error and the stackTrace. This would allow for logging/inspecting of the stack if needed.

x1z7 avatar Oct 17 '20 19:10 x1z7