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 common abstraction for error messages coming from various systems #13

Open
krainboltgreene opened this issue Feb 13, 2019 · 6 comments

Comments

@krainboltgreene
Copy link

See also: https://discourse.drone.io/t/status-500-issue-at-cloud-drone-io-for-push-webhooks-on-github/3266

Here's the logs:

{"commit":"eea3eef8056c9c1bdf69537a1c1ac71a93946c2c","error":"Not Found","event":"push","level":"warning","msg":"trigger: cannot find yaml","ref":"refs/heads/feature/SR-777","repo":"core/second-reef-api","time":"2019-02-13T00:45:24Z"}
@krainboltgreene
Copy link
Author

In reality the http status should be 424 and the message should be "respository does not have a drone configuration file".

@bradrydzewski
Copy link
Member

I think I need some context with this issue. The original discourse thread was not very clear

@bradrydzewski
Copy link
Member

ah ok, is this issue a suggestion to change the response code to 424 when the yaml does not exist? sorry, I did not understand at first.

@krainboltgreene
Copy link
Author

Well, if I get only one change in it's that the HTTP Body contains information that is very misleading and should reflect the actual issue.

But while I'm here I suggest that the status code could be more semantically correct than 500 by using 424.

@krainboltgreene
Copy link
Author

To replicate this by the way setup a drone ci, activate a project with out a configuration file, make a commit.

@bradrydzewski
Copy link
Member

bradrydzewski commented Feb 13, 2019

The 'Not Found' error message is coming from GitHub, not from Drone. This is one of many error messages that could be returned from GitHub, so returning a 424 may not always be accurate. We also integrate with Gogs, Gitea, Bitbucket, Gitlab which may use different text to indicate the file does not exist. Perhaps we could try to translate the various error payloads from the different systems to abstract the errors and provide more meaningful responses.

I am going to send this over to go-scm where we handle the abstractions.

@bradrydzewski bradrydzewski transferred this issue from harness/harness Feb 13, 2019
@bradrydzewski bradrydzewski changed the title Server returns 500, but the body is {"message":"Not Found"}, when it means "trigger: cannot find yaml" Provide common abstraction for error messages coming from various systems Feb 13, 2019
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

2 participants