Sort error handling