heroku / heroku/platform-api

No error details given when response is an HTTP 422

Open
#50 6 comments 6 reactions 0 assignees View on GitHub
bug
Dominant language
Ruby
Stars
216
Forks
85
PR merge metrics
No merged PRs in 30d

Description

```
client.domain.create('my_app', {hostname: "mydomain.com"})
Excon::Error::UnprocessableEntity: Expected([200, 201, 202, 204, 206, 304]) <=> Actual(422 Unprocessable Entity)
```

with curl:

```
curl -v -n -X POST https://api.heroku.com/apps/$MY_APP/domains -d '{ "hostname": "mydomain.com" }' -H "Content-Type: application/json" -H "Authorization: Bearer $HEROKU_API_TOKEN"
...
< HTTP/1.1 422 status code 422
...
{
"id":"invalid_params",
"message":"mydomain.com is currently in use by another app."
}
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing client.domain.create('my_app', {hostname: "mydomain.com"}) and compare the exception with the response shown from curl. Trace how the HTTP 422 response is handled and verify that the API's message, such as the domain-conflict explanation, is available in the resulting error details.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.