Added method to throw error. Replaced RuntimeException with error
handling which propagates to the frontend.