Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Runners Create - Already Exists GitlabCreateError error_message Property Type Dict Instead Of Str #2724

Open
mark-e-kibbe opened this issue Nov 16, 2023 · 1 comment
Labels

Comments

@mark-e-kibbe
Copy link

Description of the problem, including code/CLI snippet

p_runner = prj.runners.create({'runner_id': arguments.owned_runner_id})

Creating a project runner that already exists as attached will throw a GitlabCreateError exception, but the error_message propertty is of the wrong type (dict instead of str)

Per the documentation at: readthedocs, exception gitlab.GitlabCreateError(error_message: str | bytes = '', response_code: int | None = None, response_body: bytes | None = None)

Expected Behavior

GitlabCreateError error_message property should be type string when a duplicate runner id is attempted attached to a project

Actual Behavior

GitlabCreateError error_message property is type dict

Specifications

  • python-gitlab version: 4.1.1
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): 16.3
@nejch nejch added the typing label Nov 17, 2023
@nejch
Copy link
Member

nejch commented Nov 17, 2023

Thanks @mark-e-kibbe, this sounds familiar, I think I've seen the same before somewhere else, so we might need to just add dict there as one of the possible types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants