xh / toolbox

🧰 Hoist React reference app
https://toolbox.xh.io
Other
8 stars 1 forks source link

`PortfolioService.getLineChartSeriesAsync()` can throw NPE if no prices returned #695

Closed amcclain closed 7 months ago

amcclain commented 9 months ago

We see occasional error reports with an NPE thrown from PortfolioService.getLineChartSeriesAsync()

This calls portfolio/prices/ and expects to get an array of prices back from the server - it does not handle a null return, which the server will provide if the symbol is unknown or its cache is empty.

We should likely have the server throw a DataNotAvailable or similar exception for an unknown or missing symbol, then hook up meaningful error handling on the portfolio example + line charts tab to ensure we relay it back to the client (without raising a client error report)