Skip to content

Commit

Permalink
last edits on the errors docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marioiz committed Sep 23, 2022
1 parent 8d432c2 commit b411b3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ title: "Errors"
sidebar_label: "Errors"
---

A Twirp error has the properties:
A Twirp error has:

* **code**: identifies the type of error.
* **msg**: free-form message with detailed information about the error. It is meant for humans, to assist with debugging. Programs should not try to parse the error message.
* (optional) **meta**: key-value pairs with arbitrary string metadata.
* **meta**: (optional) key-value pairs with arbitrary string metadata.

## Error Codes

Valid Twirp error codes (and equivalent HTTP status):
Valid Twirp error codes (HTTP status):

* `internal` (500)
* `not_found` (404)
Expand All @@ -24,7 +24,7 @@ Valid Twirp error codes (and equivalent HTTP status):

To map a [twirp.ErrorCode](https://pkg.go.dev/github.com/twitchtv/twirp#ErrorCode) into the equivalent HTTP status, use the helper [twirp.ServerHTTPStatusFromErrorCode](https://pkg.go.dev/github.com/twitchtv/twirp#ServerHTTPStatusFromErrorCode)).

# Error responses
## Overview

A Twirp endpoint returns a [twirp.Error](https://pkg.go.dev/github.com/twitchtv/twirp#Error). For example, a "Permission

Expand Down

0 comments on commit b411b3b

Please sign in to comment.