Refactor spec to extract shared examples 'exception handler'