Use custom error function across all controllers