{"record":{"id":"d47c58411ecce7e3","repo":"eclipse-vertx/vert.x","slug":"401-unauthorized","errorCode":null,"errorMessage":"401 Unauthorized","messagePattern":"401 Unauthorized","errorType":"http","errorClass":null,"httpStatus":401,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java","lineNumber":155,"sourceCode":"  /**\n   * 308 Permanent Redirect (RFC7538)\n   */\n  HttpResponseExpectation SC_PERMANENT_REDIRECT = status(308);\n\n  /**\n   * Any 4XX client error\n   */\n  HttpResponseExpectation SC_CLIENT_ERRORS = status(400, 500);\n\n  /**\n   * 400 Bad Request\n   */\n  HttpResponseExpectation SC_BAD_REQUEST = status(400);\n\n  /**\n   * 401 Unauthorized\n   */\n  HttpResponseExpectation SC_UNAUTHORIZED = status(401);\n\n  /**\n   * 402 Payment Required\n   */\n  HttpResponseExpectation SC_PAYMENT_REQUIRED = status(402);\n\n  /**\n   * 403 Forbidden\n   */\n  HttpResponseExpectation SC_FORBIDDEN = status(403);\n\n  /**\n   * 404 Not Found\n   */\n  HttpResponseExpectation SC_NOT_FOUND = status(404);\n\n  /**\n   * 405 Method Not Allowed","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java#L137-L173","documentation":"Constant defining the 401 Unauthorized response expectation: with expecting(SC_UNAUTHORIZED), a 401 response fails the request future. 401 means authentication is required and was absent/invalid; the 'message' is the reason attached to the expectation failure.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java:155 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide valid credentials (Authorization header) before retrying","Handle the failed future for expired or missing tokens"],"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"}