Skip to content
This repository was archived by the owner on Sep 22, 2021. It is now read-only.

Commit 4c9b471

Browse files
hsanjuanStebalien
andcommitted
Improve status code descriptions
Co-Authored-By: Steven Allen <[email protected]>
1 parent 9138e00 commit 4c9b471

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

markdown.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,16 @@ Status codes used at the RPC layer are simple:
127127
- `+"`404`"+` - RPC endpoint doesn't exist
128128
- `+"`405`"+` - HTTP Method Not Allowed
129129
130-
Status code `+"`500`"+` means that the function _does_ exist, it just failed
131-
internally for some reason. To know that reason, you have to look at the
132-
"application layer" error (usually returned with the body of the command). In
133-
the case of streaming endpoints, they always return 200 before starting to
134-
stream the response. Any errors are included as Trailer response headers.
130+
Status code `+"`500`"+` means that the function _does_ exist, but IPFS was not
131+
able to fulfil the request because of an error. To know that reason, you have
132+
to look at the the error message that is usually returned with the body of the
133+
response (if no error, check the daemon logs).
134+
135+
Streaming endpoints fail as above, unless they have started streaming. That
136+
means they will have sent a `+"`200`"+` status code already. If an error
137+
happens during the stream, it will be included in a Trailer response header
138+
(some endpoints may additionally include an error in the last streamed
139+
object).
135140
136141
A `+"`405`"+`error may mean that you are using the wrong HTTP method
137142
(i.e. GET instead of POST), or that you are not allowed to call that method

0 commit comments

Comments
 (0)