Smarter error handling in console