Added custom error classes for critical and standard errors.