{"record":{"id":"29ccf41930646719","repo":"eclipse-vertx/vert.x","slug":"invalid-url","errorCode":null,"errorMessage":"Invalid url: ","messagePattern":"Invalid url: ","errorType":"exception","errorClass":"VertxException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/http/HttpConnectOptions.java","lineNumber":295,"sourceCode":"   *\n   * Note this is not related to the TCP {@link HttpClientOptions#setConnectTimeout(int)} option, when a request is made against\n   * a pooled HTTP client, the timeout applies to the duration to obtain a connection from the pool to serve the request, the timeout\n   * might fire because the server does not respond in time or the pool is too busy to serve a request.\n   *\n   * @param timeout the amount of time in milliseconds.\n   * @return a reference to this, so the API can be used fluently\n   */\n  public HttpConnectOptions setConnectTimeout(long timeout) {\n    this.connectTimeout = timeout;\n    return this;\n  }\n\n  private URL parseUrl(String surl) {\n    // Note - parsing a URL this way is slower than specifying host, port and relativeURI\n    try {\n      return new URL(surl);\n    } catch (MalformedURLException e) {\n      throw new VertxException(\"Invalid url: \" + surl, e);\n    }\n  }\n\n  public JsonObject toJson() {\n    JsonObject json = new JsonObject();\n    HttpConnectOptionsConverter.toJson(this, json);\n    Address serverAddr = this.server;\n    if (serverAddr instanceof SocketAddress) {\n      SocketAddress socketAddr = (SocketAddress) serverAddr;\n      json.put(\"server\", socketAddr.toJson());\n    }\n    return json;\n  }\n}\n","sourceCodeStart":277,"sourceCodeEnd":310,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/http/HttpConnectOptions.java#L277-L310","documentation":"URL parsing failure in HttpConnectOptions.parseUrl: the supplied URI string could not be parsed (bad syntax, unsupported scheme, or missing authority). The message is a generic sentinel prefixed 'Invalid url: ' with the parse error appended; the input at fault is the url string being parsed.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/http/HttpConnectOptions.java:295 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix or URL-encode the URI string before passing it","Validate user-supplied URLs with a URI parser before configuring the request"],"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"}