handleerror for all controllers