Better error handling for the front-end UI