Custom exception
Also written: ProductNotFoundException, OutOfStockException
Your own exception class extending RuntimeException, such as ProductNotFoundException. The service throws it and ApiErrors turns it into an HTTP answer.
Also written: ProductNotFoundException, OutOfStockException
Your own exception class extending RuntimeException, such as ProductNotFoundException. The service throws it and ApiErrors turns it into an HTTP answer.