Closed mmazurkevich closed 7 months ago
As I see in the example of error message from server there has to be no nested objects in the JSON from the server https://replicate.com/docs/reference/http#rate-limits
Also it worth to mention the requirements for the name somewhere in the documentation, at least in the https://replicate.com/docs/reference/http
Hi @mmazurkevich. Thanks for reporting. The response sent by Replicate's API for invalid models in the POST /models
endpoint is incorrect. This is something we'll need to fix on our side.
@mmazurkevich I'm happy to say that this is now fixed. Replicate's API now returns error objects in the form of RFC 9457 problem details. I just ran replicate model create
with an invalid hardware sku, and it correctly repoted the error instead of panicking with that JSON error. Thanks again for reporting!
I've got it from
replicate-go@v0.14.2/apierror.go
unmarshalAPIError
function. Exception at unmarshalling doesn't allow me to see the original root cause of the request failure.Example of JSON:
failed with with the following exception:
Unknown error: json: cannot unmarshal object into Go struct field APIError.detail of type string