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

Provide more useful error messages #519

Open
sean797 opened this issue Aug 6, 2018 · 0 comments
Open

Provide more useful error messages #519

sean797 opened this issue Aug 6, 2018 · 0 comments

Comments

@sean797
Copy link
Contributor

sean797 commented Aug 6, 2018

Often when updating or creating an object with foreman-ansible-modules the user can get an error like "Error while updating ProvisioningTemplate: 422 Client Error: Unprocessable Entity for url: https://localhost/api/v2/provisioning_templates/135" the later part is returned from python-requests (https://github.com/requests/requests/blob/master/requests/models.py#L937) but it isn't very helpful and a user often has to go and look in production.log

The foreman API does more often than not return an error in the following format

{
    "error": {
        "errors": {
            "base": [
                "This template is locked. Please clone it to a new template to customize."
            ]
        },
        "full_messages": [
            "This template is locked. Please clone it to a new template to customize."
        ],
        "id": 59
    }
}

It would be really nice if we can provide these error messages to users.

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

No branches or pull requests

1 participant