add user-friendly error descriptions to JobError #270
+23
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit extracts ErrorDescription from the updated Hyperv job object fetched inside WaitJob to provide an updated description of the error.
What happens is that Hyper-V starts the job in background and immediately returns a reference to it which is saved by the BeginInvoke().Out() to an object. If we do not refresh this object, it's like we are always working on an old snapshot and the description will never be updated.
Inside WaitJob the object is actually re-fetched and it contains the updated error message. By reusing it, we can provide a detailed error description instead of just error code.
it fixes #216