0

I'm making two api calls and result of one should be merged with second api call i need to write these two like below

@RequestMapping("/greeting") public Greeting greeting() {   

for(RTM rtm: callAPIFuncA()) {

       try {

        }       catch(Exception e) {
          log(e);           }   }

    for(NonRTM nRTM: callAPIFuncB()) {
       try {

        }       catch(Exception e) {
           log(e);          }

    }

return new Greeting(responseMap);

}

But the problem i am running into is first api returns data but second one gets an exception , i wanted to return the response even if any one of the api call fails. please tell me what i need to change in my code to make it work. rightnow the api calls return data but in next for loop when i make a second api call it gives exception and never return the data eve from the first successful api call

u32i64
  • 2,384
  • 3
  • 22
  • 36
zm10
  • 227
  • 1
  • 5
  • 18

0 Answers0