Skip to content

Emit raw error message when API calls fail? #149

Description

@ww-oai

Hi there!

I'm trying to diagnose an HTTP 400 I'm seeing from GitLab's API when using this action. Unfortunately, the error message surfaced by this action is pretty opaque:

Error: GitLab API returned status code 400.

That comes from here:

let errorMessage = `GitLab API returned status code ${response.status}.`;

I think this could be improved by dumping the (raw) JSON from the error response. Ideally we'd extract the exact message, but GitLab doesn't seem to do a great job of guaranteeing the shape:

https://docs.gitlab.com/api/rest/troubleshooting/#status-code-400

If that sounds reasonable, I'm happy to send a PR that adds a dump of the JSON when verbose: true is enabled.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions