Standardized error logic