better error handling for web app errors