public function addError(Exception $error)
    {
        $errorNode = $this->addElement("error", $error->getMessage());

        if (!$error instanceof NoRecordsMatchException) {
            $this->status = '400';
        }

        if ($error->getErrorName()) {
            $errorNode->setAttribute("code", $error->getErrorName());
        } else {
            $errorNode->setAttribute("code", "badArgument");
        }
    }
public function addError(Exception $error)
    {
        $errorNode = $this->addElement("error", $error->getMessage());

        if (!$error instanceof NoRecordsMatchException) {
            $this->status = '400';
        }

        if ($error->getErrorName()) {
            $errorNode->setAttribute("code", $error->getErrorName());
        } else {
            $errorNode->setAttribute("code", "badArgument");
        }
    }
public function addError ( Exception $ error ) { $ errorNode = $ this -> addElement ( "error" , $ error -> getMessage ( ) ) ; if ( ! $ error instanceof NoRecordsMatchException ) { $ this -> status = '400' ; } if ( $ error -> getErrorName ( ) ) { $ errorNode -> setAttribute ( "code" , $ error -> getErrorName ( ) ) ; } else { $ errorNode -> setAttribute ( "code" , "badArgument" ) ; } }
adds an error node base on a Exception
@param Exception $error
adds an error node base on a Exception