Skip to content

repo-create: failure message when HTTP 400 is too opaque #63

@salewski

Description

@salewski

When the ads-github-repo-create tool errors out due to an HTTP 400 status from the GitHub API, the error message shown to the user is less useful than it could be:

    ads-github-repo-create (error): HTTP response code was: "400"; expected 201 ("Created"); bailing out

It wouldn't be the end of the world if it more data were available by cranking up the '-v' opts, but that doesn't yield anything more useful in this regard:

...
+ t_http_code=400
+ t_estat=0
+ test 0 -ne 0
+ test -z 400
+ test 201 = 400
+ printf 'ads-github-repo-create (error): HTTP response code was: "%s"; expected 201 ("Created"); bailing out\n' 400
ads-github-repo-create (error): HTTP response code was: "400"; expected 201 ("Created"); bailing out
+ exit 1
+ f_cleanup
...

The user knows that the problem in on the calling side (4xx), but is left guessing as to what the problem might be.

There is likely useful information in the HTTP response body file. Even just dumping its raw contents to stderr would be better than the current behavior.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions