Skip to content

Error details for stepwise long-running operations #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
letmaik opened this issue Nov 27, 2020 · 1 comment
Open

Error details for stepwise long-running operations #222

letmaik opened this issue Nov 27, 2020 · 1 comment

Comments

@letmaik
Copy link
Member

letmaik commented Nov 27, 2020

Services MUST perform as much synchronous validation as practical on stepwise requests. Services MUST prioritize returning errors in a synchronous way, with the goal of having only "Valid" operations processed using the long running operation wire protocol.

How should error details be exposed for operation failures? The guidelines are silent about that, whereas I would have expected that an OData-style "error" field should be included in the response.

I similarly can't see how real APIs deal with that which seems extremely odd: https://docs.microsoft.com/en-us/azure/cognitive-services/computer-vision/concept-recognizing-text

@letmaik
Copy link
Member Author

letmaik commented Feb 13, 2023

While the general guidelines are silent about it, the Azure guidelines are more prescriptive: https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#obtaining-status-and-results-of-long-running-operations. It may be worth recommending to use the "error" field in the general guidelines as well.

DO return a status monitor in the response body that conforms with the following structure:

OperationStatus : Object

Property Type Required Description
id string true The unique id of the operation
status string true enum that includes values "NotStarted", "Running", "Succeeded", "Failed", and "Canceled"
error ErrorDetail Error object that describes the error when status is "Failed"
result object Only for POST action-type LRO, the results of the operation when completed successfully
additional
properties
Additional named or dynamic properties of the operation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant