Correctly handle all error types