Add custom error handling support