project-satisfy / satisfy

Satis composer repository manager with a Web UI
http://ludofleury.github.io/satisfy/
MIT License
514 stars 109 forks source link

Return HTTP status code 500 if the build fails #166

Closed Baldinof closed 2 years ago

Baldinof commented 2 years ago

Hi!

Currently if during the webhook call something bad happens, the HTTP status code will be 200, and the body will contains the command exit code.

This makes hard for the webhook consumers to know if it failed.

With this PR, if the webhhok URL contains a query parameter fail_on_error, it will return a 500 response.

ramunasd commented 2 years ago

I would suggest to return error status code instead adding params to query.

Baldinof commented 2 years ago

I am not sure I understand you, what do you mean by return error status code? The process exit status is already in the response body.

We could always return 500 in case of an exit status code !== 0, but it could break existing integrations.

ramunasd commented 2 years ago

So let's return 500 in case of error.