Why not put it directly into $data['error']