{"record":{"id":"32c9ed9b1f01c0aa","repo":"eclipse-vertx/vert.x","slug":"511-network-authentication-required-rfc6585","errorCode":null,"errorMessage":"511 Network Authentication Required (RFC6585)","messagePattern":"511 Network Authentication Required \\(RFC6585\\)","errorType":"http","errorClass":null,"httpStatus":511,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java","lineNumber":335,"sourceCode":"  /**\n   * 506 Variant Also Negotiates (RFC2295)\n   */\n  HttpResponseExpectation SC_VARIANT_ALSO_NEGOTIATES = status(506);\n\n  /**\n   * 507 Insufficient Storage (WebDAV, RFC4918)\n   */\n  HttpResponseExpectation SC_INSUFFICIENT_STORAGE = status(507);\n\n  /**\n   * 510 Not Extended (RFC2774)\n   */\n  HttpResponseExpectation SC_NOT_EXTENDED = status(510);\n\n  /**\n   * 511 Network Authentication Required (RFC6585)\n   */\n  HttpResponseExpectation SC_NETWORK_AUTHENTICATION_REQUIRED = status(511);\n\n  /**\n   * Creates an expectation asserting that the status response code is equal to {@code statusCode}.\n   *\n   * @param statusCode the expected status code\n   */\n  static HttpResponseExpectation status(int statusCode) {\n    return status(statusCode, statusCode + 1);\n  }\n\n  static HttpResponseExpectation status(int min, int max) {\n    return new HttpResponseExpectation() {\n      @Override\n      public boolean test(HttpResponseHead value) {\n        int sc = value.statusCode();\n        return sc >= min && sc < max;\n      }\n","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java#L317-L353","documentation":"Constant defining the 511 Network Authentication Required response expectation: applying expecting(SC_NETWORK_AUTHENTICATION_REQUIRED) makes a 511 response fail the request future. The client must authenticate to gain network access (captive portal); the 'message' is the reason on the failed future.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java:335 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Handle the failure by guiding the user through network authentication","Do not treat 511 as a service outage"],"exampleFix":null,"handlingStrategy":"try-catch","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-14T00:17:10.932Z"}