-
Notifications
You must be signed in to change notification settings - Fork 786
New error codes topic #4465
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
Merged
Merged
New error codes topic #4465
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
263db69
create new errors topic
hhunter-ms 78f427d
overview draft
hhunter-ms d347626
Merge branch 'v1.15' into 4422_ext
hhunter-ms abc1f55
Update daprdocs/content/en/developing-applications/error-codes/errors…
hhunter-ms a5c2936
Update daprdocs/content/en/developing-applications/error-codes/errors…
hhunter-ms 9006404
Update daprdocs/content/en/developing-applications/error-codes/http-e…
hhunter-ms fd91065
Merge branch 'v1.15' into 4422_ext
hhunter-ms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
daprdocs/content/en/developing-applications/error-codes/_index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| type: docs | ||
| title: "Error codes" | ||
| linkTitle: "Error codes" | ||
| weight: 20 | ||
| description: "Error codes and messages you may encounter while using Dapr" | ||
| --- | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
daprdocs/content/en/developing-applications/error-codes/errors-overview.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| --- | ||
| type: docs | ||
| title: "Errors overview" | ||
| linkTitle: "Overview" | ||
| weight: 10 | ||
| description: "Overview of Dapr errors" | ||
| --- | ||
|
|
||
| An error code is a numeric or alphamueric code that indicates the nature of an error and, when possible, why it occured. | ||
|
|
||
| Dapr error codes are standardized strings for over 80+ common errors across HTTP and gRPC requests when using the Dapr APIs. These codes are both: | ||
| - Returned in the JSON response body of the request. | ||
| - When enabled, logged in debug-level logs in the runtime. | ||
| - If you're running in Kubernetes, error codes are logged in the sidecar. | ||
| - If you're running in self-hosted, you can enable and run debug logs. | ||
|
|
||
| ## Error format | ||
|
|
||
| Dapr error codes consist of a prefix, a category, and shorthand of the error itself. For example: | ||
|
|
||
| | Prefix | Category | Error shorthand | | ||
| | ------ | -------- | --------------- | | ||
| | ERR_ | PUBSUB_ | NOT_FOUND | | ||
|
|
||
| Some of the most common errors returned include: | ||
|
|
||
| - ERR_ACTOR_TIMER_CREATE | ||
| - ERR_PURGE_WORKFLOW | ||
| - ERR_STATE_STORE_NOT_FOUND | ||
| - ERR_HEALTH_NOT_READY | ||
|
|
||
| > **Note:** [See a full list of error codes in Dapr.]({{< ref error-codes-reference.md >}}) | ||
|
|
||
| An error returned for a state store not found might look like the following: | ||
|
|
||
| ```json | ||
| { | ||
| "error": "Bad Request", | ||
| "error_msg": "{\"errorCode\":\"ERR_STATE_STORE_NOT_FOUND\",\"message\":\"state store <name> is not found\",\"details\":[{\"@type\":\"type.googleapis.com/google.rpc.ErrorInfo\",\"domain\":\"dapr.io\",\"metadata\":{\"appID\":\"nodeapp\"},\"reason\":\"DAPR_STATE_NOT_FOUND\"}]}", | ||
| "status": 400 | ||
| } | ||
| ``` | ||
|
|
||
| The returned error includes: | ||
| - The error code: `ERR_STATE_STORE_NOT_FOUND` | ||
| - The error message describing the issue: `state store <name> is not found` | ||
| - The app ID in which the error is occuring: `nodeapp` | ||
| - The reason for the error: `DAPR_STATE_NOT_FOUND` | ||
|
|
||
| ## Dapr error code metrics | ||
|
|
||
| Metrics help you see when exactly errors are occuring from within the runtime. Error code metrics are collected using the `error_code_total` endpoint. This endpoint is disabled by default. You can [enable it using the `recordErrorCodes` field in your configuration file]({{< ref "metrics-overview.md#configuring-metrics-for-error-codes" >}}). | ||
|
|
||
| ## Demo | ||
|
|
||
| Watch a demo presented during [Diagrid's Dapr v1.15 celebration](https://www.diagrid.io/videos/dapr-1-15-deep-dive) to see how to enable error code metrics and handle error codes returned in the runtime. | ||
|
|
||
| <iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/NTnwoDhHIcQ?si=I2uCB_TINGxlu-9v&start=2812" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> | ||
|
|
||
| ## Next step | ||
|
|
||
| {{< button text="See a list of all Dapr error codes" page="error-codes-reference" >}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
daprdocs/content/en/developing-applications/error-codes/http-error-codes.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
| type: docs | ||
| title: "Handling HTTP error codes" | ||
| linkTitle: "HTTP" | ||
| description: "Detailed reference of the Dapr HTTP error codes and how to handle them" | ||
| weight: 30 | ||
| --- | ||
|
|
||
| For HTTP calls made to Dapr runtime, when an error is encountered, an error JSON is returned in response body. The JSON contains an error code and an descriptive error message. | ||
|
|
||
| ``` | ||
| { | ||
| "errorCode": "ERR_STATE_GET", | ||
| "message": "Requested state key does not exist in state store." | ||
| } | ||
| ``` | ||
|
|
||
| ## Related | ||
|
|
||
| - [Error code reference list]({{< ref error-codes-reference.md >}}) | ||
| - [Handling gRPC error codes]({{< ref grpc-error-codes.md >}}) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check, but I feel this error format is the same as the one above. List this. I need to check with Alice on this, or ask Jake or watch the video again
{ "error": "Bad Request", "error_msg": "{\"errorCode\":\"ERR_STATE_STORE_NOT_FOUND\",\"message\":\"state store <name> is not found\",\"details\":[{\"@type\":\"type.googleapis.com/google.rpc.ErrorInfo\",\"domain\":\"dapr.io\",\"metadata\":{\"appID\":\"nodeapp\"},\"reason\":\"DAPR_STATE_NOT_FOUND\"}]}", "status": 400There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msfussell what I have, I grabbed from the video while it was paused