Improved CLI exception handling