Np null on some path from return value

I am getting a null returned when I try to do the following thing and it gives a spotbug error when doing ./gradlew build :

TiingoCandle[ ] arr=restTemplate.getForObject(api_url,TiingoCandle.class).
} catch(Exception e){

Now,how to remove this error and remove this spotbug error ?

Then you must throw a Nullpointerexception in the catch itself.

Do you mean that I should change the (Exception e) to (NullPointerException e) in the cathc statement?

No I am saying that
In catch block
u need to throw Nullpointerexception

throw new Nullpointerexception(e.getMessage())

It still shows null point return during build

Or else you can just return null inside the catch block
return null;
It worked for me