Add error codes to categorize failures