{"record":{"id":"6f1ff77cc6dbe932","repo":"eclipse-vertx/vert.x","slug":"size-must-be-0","errorCode":null,"errorMessage":"size must be > 0","messagePattern":"size must be > 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"info","filePath":"vertx-core/src/main/java/io/vertx/core/DeploymentOptions.java","lineNumber":208,"sourceCode":"   * When the verticle does not use a {@link #getWorkerPoolName() named worker pool}, this option has no effect.\n   *\n   * @return the maximum number of worker threads\n   */\n  public int getWorkerPoolSize() {\n    return workerPoolSize;\n  }\n\n  /**\n   * Set the maximum number of worker threads to be used by the Vert.x instance.\n   * <p>\n   * When the verticle does not use a {@link #getWorkerPoolName() named worker pool}, this option has no effect.\n   *\n   * @param workerPoolSize the number of threads\n   * @return a reference to this, so the API can be used fluently\n   */\n  public DeploymentOptions setWorkerPoolSize(int workerPoolSize) {\n    if (workerPoolSize < 1) {\n      throw new IllegalArgumentException(\"size must be > 0\");\n    }\n    this.workerPoolSize = workerPoolSize;\n    return this;\n  }\n\n  /**\n   * Get the value of max worker execute time, in {@link DeploymentOptions#setMaxWorkerExecuteTimeUnit maxWorkerExecuteTimeUnit}.\n   * <p>\n   * Vert.x will automatically log a warning if it detects that worker threads haven't returned within this time.\n   * <p>\n   * This can be used to detect where the user is blocking a worker thread for too long. Although worker threads\n   * can be blocked longer than event loop threads, they shouldn't be blocked for long periods of time.\n   * <p>\n   * When the verticle does not use a {@link #getWorkerPoolName() named worker pool}, this option has no effect.\n   *\n   * @return The value of max worker execute time, the default value of {@link DeploymentOptions#setMaxWorkerExecuteTimeUnit} {@code maxWorkerExecuteTimeUnit} is {@link TimeUnit#NANOSECONDS}\n   */\n  public long getMaxWorkerExecuteTime() {","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/DeploymentOptions.java#L190-L226","documentation":"SC_NOT_IMPLEMENTED is a public HttpResponseExpectation constant in Vert.x core asserting that an HTTP response status equals 501. It is not thrown by the library; it is an expectation passed to HttpResponseExpectation-based validation (e.g. expect(SC_NOT_IMPLEMENTED)) which fails the response handling when the server returns a different status. The message '501 Not Implemented' appears when the expectation check fails and the mismatch is reported.","triggerScenarios":"Calling vertx HTTP client expectation APIs (io.vertx.core.http.HttpResponseExpectation.SC_NOT_IMPLEMENTED, e.g. request.expect(HttpResponseExpectation.SC_NOT_IMPLEMENTED) or Future.expect) against a response whose status code is not exactly 501.","commonSituations":"Testing that a server rejects unsupported HTTP methods/features; asserting a proxy returns 501 for an unsupported upgrade; writing contract tests where the endpoint should not implement an operation.","solutions":["Ensure the request under test is actually expected to produce 501; if any 2xx is acceptable, drop the expectation or use a status-range expectation instead.","Inspect the actual response status returned by the server and align the expectation (e.g. use SC_OK or SC_BAD_REQUEST) or fix the server behavior.","If you need a custom set of statuses, build the expectation with HttpResponseExpectation.status(int) or the oneOf-style combinators rather than a single 501 constant."],"exampleFix":"// before\nrequest.expect(HttpResponseExpectation.SC_NOT_IMPLEMENTED).send().onSuccess(resp -> ...);\n// after\nrequest.expect(HttpResponseExpectation.status(200)).send().onSuccess(resp -> ...);","handlingStrategy":"validation","validationCode":"int status = 501; // only assert SC_NOT_IMPLEMENTED if the contract guarantees this code\nif (expectedStatus != 501) throw new IllegalArgumentException(\"Use HttpResponseExpectation.status(\" + expectedStatus + \") instead\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match the expectation to the documented response contract of the endpoint.","Use status-range expectations for tolerant validation instead of exact 5xx constants.","Write integration tests against the real server before locking in a status expectation."],"tags":["http","status-code","expectation","vertx-core"],"backgroundTag":"http-error-status","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"}