E
E
Eugene2012-02-10 12:55:15
Yii
Eugene, 2012-02-10 12:55:15

Error handling in Yii?

In my application, I interpret the XML string into an object with the simplexml_load_string function, while I know for sure that the schemaLocation attribute is not an absolute path.
Naturally, I get a warning "namespace warning: xmlns: URI DTS is not absolute", but the function works fine and at the output I have the correct SimpleXMLElement with which I can work further.
The problem is that E_WARNING fires the errorHandler and terminates the application.
According to the error handling scheme, the continuation of the script is possible only when YII_ENABLE_ERROR_HANDLER is disabled.
I ask for your advice on how to get around this problem without disabling the error handler and without escaping the error with @.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arsen, 2012-02-10
@Agent_J

Try
libxml_use_internal_errors( true )

W
WebSpider, 2012-02-10
@WebSpider

Doesn't Yii convert errors into exceptions? If yes, then you can wrap it in a try...catch block

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question