A value-taking function (first arg to new Promise
callback)
An error-taking function (second arg to new Promise
callback)
The job result you want to settle the promise with. An error will be thrown if it's undefined.
If the result is an error, it is marked as handled.
Fulfill a Promise from a JobResult
If the result is a CancelResult, the promise is rejected with a CancelError. Otherwise it is resolved or rejected according to the state of the result.