{"record":{"id":"78a0c888ebf79498","repo":"eclipse-vertx/vert.x","slug":"502-bad-gateway","errorCode":null,"errorMessage":"502 Bad Gateway","messagePattern":"502 Bad Gateway","errorType":"http","errorClass":null,"httpStatus":502,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java","lineNumber":300,"sourceCode":"  /**\n   * Any 5XX server error\n   */\n  HttpResponseExpectation SC_SERVER_ERRORS = status(500, 600);\n\n  /**\n   * 500 Internal Server Error\n   */\n  HttpResponseExpectation SC_INTERNAL_SERVER_ERROR = status(500);\n\n  /**\n   * 501 Not Implemented\n   */\n  HttpResponseExpectation SC_NOT_IMPLEMENTED = status(501);\n\n  /**\n   * 502 Bad Gateway\n   */\n  HttpResponseExpectation SC_BAD_GATEWAY = status(502);\n\n  /**\n   * 503 Service Unavailable\n   */\n  HttpResponseExpectation SC_SERVICE_UNAVAILABLE = status(503);\n\n  /**\n   * 504 Gateway Timeout\n   */\n  HttpResponseExpectation SC_GATEWAY_TIMEOUT = status(504);\n\n  /**\n   * 505 HTTP Version Not Supported\n   */\n  HttpResponseExpectation SC_HTTP_VERSION_NOT_SUPPORTED = status(505);\n\n  /**\n   * 506 Variant Also Negotiates (RFC2295)","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java#L282-L318","documentation":"Constant defining the 502 Bad Gateway response expectation: with expecting(SC_BAD_GATEWAY), a 502 response fails the request future. The server (acting as gateway/proxy) got an invalid upstream response; the 'message' is the reason attached to the expectation failure.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java:300 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request, as 502 is often a transient upstream failure","Report the upstream problem if it persists"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}