PDA

View Full Version : Web-Api parser, error handling


JoeBe
07-09-2008, 08:29 AM
Hey.

I need a way to check if an error occur when we send an mail into Cerberus. I have got the parser to post into our buckets.

But now for the error handling, on the site http://wiki.cerb4.com/wiki/Web-API -> Parser, is this the only information i find.

-----------------------
Response:

Status: 200 OK

<ticket>
<id>605</id>
<mask>CWI-78923-674</mask>
</ticket>
-----------------------

But how do i check if i get Status: 200 OK? If it's 200, ok send the mail. If it isn't will an error occur and tell the people that it couldn't parse the message.

Can you give me a code example?

Regards Jörgen

Hildy
07-09-2008, 05:40 PM
It'll send back "Message could not be parsed." in the event of a problem.

Search for "function _postSourceParseAction($path)" in http://svn.webgroupmedia.com/cerb4/cerb4/plugins/cerberusweb.webapi/api/App.php