Closed levibostian closed 6 years ago
Closing for now. As I said before, at this time, Wendy only needs to know a task did fail. It doesn't need to know the reason. That is for the developer to take care of.
The only time that I would see this valuable is after a task fails, having a String available to show to the user in the UI. Since there exists a listener to see the status of a PendingTask
, in that status listener it may be able to pass a Throwable
or a String
along when it does fail, yeah?
Instead of returning an error after runTask()
runs for a specific PendingTask
, what I could do is provide a feature to Wendy as an error datastore.
I imagine something like this:
task_id
, here is an error message I will use to show to the user, here is a tag identifying the error and how to resolve it for myself later on". task_id
?". Wendy will pull the entry in the database and return it to the user. Also, there would be a way to say, "Wendy, this task with task_id
of ____ has been resolved. No more error." and Wendy would delete the entry from the database.
My thought process behind this is that:
task_id
have an error recorded for it that needs resolved?" to indicate if there is an error or not to show and take care of. I would also provide a way to query Wendy for all errors of a certain tag and get all errors that exist at the moment. Maybe a developer wants to show a list of errors in the app that the user needs to take care of.
Also, providing an error listener would be nice in the app. Get notified when errors occur so the app could show a notification in the task bar?
This is done and will be merged into the next release of Wendy.
When a
PendingTask
runs, if it fails, there is currently no best pattern for handling that error.I would prefer to not have wendy involved with this as much as possible because it doens't matter why a task fails to Wendy, just if it did fail.
Go into the example app, when it randomly fails it's pending task, have it also randomly generate a random error of some sort and determine the best way to fix this.