{"record":{"id":"63bc1bf8c0bdcfb6","repo":"eclipse-vertx/vert.x","slug":"402-payment-required","errorCode":null,"errorMessage":"402 Payment Required","messagePattern":"402 Payment Required","errorType":"http","errorClass":null,"httpStatus":402,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java","lineNumber":160,"sourceCode":"  /**\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\n   */\n  HttpResponseExpectation SC_METHOD_NOT_ALLOWED = status(405);\n\n  /**\n   * 406 Not Acceptable","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java#L142-L178","documentation":"Constant defining the 402 Payment Required response expectation: applying it via expecting(...) turns a 402 response into a failed request future. 402 is reserved for payment schemes; the 'message' is the reason reported in the expectation failure.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/http/HttpResponseExpectation.java:160 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Handle the failure according to your payment flow","Use a custom expectation if 402 is a normal outcome in your protocol"],"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"}