Open haadcode opened 7 years ago
This should be pretty easy to fix actually. Though is your example accurate? I don't think we ever return an object with code == 500 (or any http status codes for that matter)
I think for this one, we will want to wait for @keks refactor of the commands lib. It should make unification of everything a tad simpler
@lgierth did you latest PR solve this?
@lgierth did you latest PR solve this?
Nope
Version information:
0.4.5-pre1.
Type:
Bug
Priority:
P3?
Description:
When the go-ipfs HTTP API is queried and an error occurs during the query, go-ipfs returns the error in format
{ Code: 500, Message: "Omg!" }
(JSON). However, when the requested endpoint is not found and a 404 is returned, the error is not in JSON but a string.This is annoying because we have to handle 404 separately from other errors in js-ipfs-api. It'd be great if all errors were returned in the same format.
Perhaps set the content-type header for 404 to 'application/json'.