{"record":{"id":"7527adfef0e33d08","repo":"eclipse-vertx/vert.x","slug":"connecttimeout-must-be-0","errorCode":null,"errorMessage":"connectTimeout must be >= 0","messagePattern":"connectTimeout must be >= 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/net/ClientOptionsBase.java","lineNumber":152,"sourceCode":"    return this;\n  }\n\n  /**\n   * @return the value of connect timeout\n   */\n  public int getConnectTimeout() {\n    return connectTimeout;\n  }\n\n  /**\n   * Set the connect timeout\n   *\n   * @param connectTimeout  connect timeout, in ms\n   * @return a reference to this, so the API can be used fluently\n   */\n  public ClientOptionsBase setConnectTimeout(int connectTimeout) {\n    if (connectTimeout < 0) {\n      throw new IllegalArgumentException(\"connectTimeout must be >= 0\");\n    }\n    this.connectTimeout = connectTimeout;\n    return this;\n  }\n\n  /**\n   * @return the metrics name identifying the reported metrics.\n   */\n  public String getMetricsName() {\n    return metricsName;\n  }\n\n  /**\n   * Set the metrics name identifying the reported metrics, useful for grouping metrics\n   * with the same name.\n   *\n   * @param metricsName the metrics name\n   * @return a reference to this, so the API can be used fluently","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/net/ClientOptionsBase.java#L134-L170","documentation":"Configuration validation in ClientOptionsBase.setConnectTimeout: the TCP connect timeout in milliseconds must be non-negative (0 means no timeout). Negative timeouts are meaningless and rejected before the field is assigned.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/net/ClientOptionsBase.java:152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a value >= 0 (0 disables the timeout)","Validate configuration deserialized from JSON before applying"],"exampleFix":null,"handlingStrategy":"validation","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"}