-3

my code is like below

try{
    System.out.println("index"+index);
    System.out.println("Inside getPayloadFromKibana elsatic host" + elasticHost);
    RestHighLevelClient restClient = new RestHighLevelClient(RestClient
                    .builder(new HttpHost(elasticHost, 7008, "http"))//here port number is differnt.
                    .setRequestConfigCallback(
                            requestConfigBuilder -> requestConfigBuilder.setConnectTimeout(60000).setSocketTimeout(60000))
                    .setMaxRetryTimeoutMillis(60000));
    System.out.println("restClient ::"+restClient);
    SearchRequest searchRequest = new SearchRequest();
    -----
    }catch(Exception e){
    }
    finally{}

when i execute my project in debug mode i see that my controll is going to finally block when ever it runs on RestHighLevelClient creating object , and it is not giving any exception or not coming into catch block , why it is behaving like this can any one please help here?

deceze
  • 510,633
  • 85
  • 743
  • 889
  • 1
    Could it be that somewhere in creating the RestHighLevel, a `Throwable` is being thrown? Not all `Throwable` objects are `Exception` objects. – Dawood ibn Kareem Jul 21 '21 at 10:10
  • 3
    There is no statement in the catch block, so if an exception is thrown, there is no line the debugger could stop at. – Izruo Jul 21 '21 at 10:20

1 Answers1

-1

You may not be using debug mode correctly. Try expanding the Catch block and test using .

Sergey Zh.
  • 347
  • 2
  • 3
  • 13