protected function _toData($errors)
    {
        $data = array();

        foreach ($errors as $error) {
            if ($error instanceof Exception) {
                $data[] = array('code' => $error->getCode(),'message' => $error->getMessage());
            } elseif ($error instanceof AnError) {
                $data[] = $error->toArray();
            }
        }

        return $data;
    }