Replace errors with Exceptions