Dushan Abeyruwan wrote
>   We did major refactoring to JSON by moving from Jettison to Staxon,
> please refer org.apache.synapse.commons.json.JsonUtil under synapse
> commons.

Thanks Dushan, we will look in to this. 


Dushan Abeyruwan wrote
>   throwing exception there is nothing to re-invent, look at simple inbuilt
> mediators, such as Iterator, Payload etc.. see how exceptions are
> handled..
> 
> catch (AxisFault af) {
>             handleException("Error creating an iterated copy of the
> message", af, synCtx);
>         }
> 
> 
> /**
>      * Perform an error log message to all logs @ ERROR. Writes to the
> general log, the service log
>      * and the trace log (of trace is on) and throws a SynapseException
>      * @param msg the log message
>      * @param e an Exception encountered
>      * @param msgContext the message context
>      */
>     protected void handleException(String msg, Exception e, MessageContext
> msgContext) {
>         log.error(msg, e);
>         if (msgContext.getServiceLog() != null) {
>             msgContext.getServiceLog().error(msg, e);
>         }
>         if (shouldTrace(msgContext.getTracingState())) {
>             trace.error(msg, e);
>         }
>         throw new SynapseException(msg, e);
>     }

We used a fault mediator to capture ERROR_MESSAGE if it is stored, and threw
a soap fault if that is the case. Would this be sufficient? 

Thanks. 



--
View this message in context: 
http://wso2-oxygen-tank.10903.n7.nabble.com/Parsing-JSON-as-XML-and-handling-exceptions-tp91557p91614.html
Sent from the WSO2 Development mailing list archive at Nabble.com.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to