Skip to content

Commit

Permalink
fix(rest): more meaningful error message on invalid host (#2245)
Browse files Browse the repository at this point in the history
  • Loading branch information
igpetrov authored and johnBgood committed Mar 27, 2024
1 parent 6405d80 commit 8e1ca18
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.http.HttpStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -75,6 +77,9 @@ public HttpResponse executeHttpRequest(
}
}
throw new ConnectorException(errorCode, errorMessage, hrex);
} catch (UnknownHostException uhe) {
throw new ConnectorException(
HttpStatus.SC_NOT_FOUND + "", "Unknown host: " + externalRequest.getUrl(), uhe);
}
}

Expand Down

0 comments on commit 8e1ca18

Please sign in to comment.