Graceful degradation for refs endpoint
What does this MR do and why?
Contributes to #351520 (closed)
Problem
We have an unhandled exception when Gitaly is not available.
Solution
Return 503 error with an error message.
Screenshots or screen recordings
Before | After |
---|---|
There is no UI difference, because we equally handle 500 and 503 errors. However, now API responds with a structured error message and a proper http error code.
How to set up and validate locally
- Visit http://127.0.0.1:3000/flightjs/Flight/refs
- Disable Gitaly (
gdk stop gitaly
) - Visit http://127.0.0.1:3000/flightjs/Flight/refs
- Check that the response code is 503 and the response contains an error message.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Vasilii Iakliushin