dartz
dartz copied to clipboard
[Feature request] Add `StackTrace` to `Task`
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.