DWR printStackTrace error message ?

View: New views
2 Messages — Rating Filter:   Alert me  

DWR printStackTrace error message ?

by czyjava :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have defined this in dwr.xml:

<convert match="java.lang.Exception" converter="exception">
            <param name='include' value='message,lineNumber'/>
        </convert>
        <convert match="java.lang.StackTraceElement" converter="bean"/>

and define global variable:

 function dwrErrorHandler(msg) {
                alert("DWR error : "+msg);
            }

            dwr.engine.setErrorHandler(dwrErrorHandler);

My question is
how could I dump error message line by line, like printStackTrace() in
java ?

Thanks.
Edward

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: DWR printStackTrace error message ?

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The error handle actually will pass the exception too.  So change your dwrErrorhandler function to take it:

function dwrErrorHandler(msg, exception) {
    .....
}

Now you have the exception and you can do what you would like with it.

On Tue, Jul 14, 2009 at 8:00 AM, czy11421 <czy11421@...> wrote:
I have defined this in dwr.xml:

<convert match="java.lang.Exception" converter="exception">
          <param name='include' value='message,lineNumber'/>
      </convert>
      <convert match="java.lang.StackTraceElement" converter="bean"/>

and define global variable:

function dwrErrorHandler(msg) {
              alert("DWR error : "+msg);
          }

          dwr.engine.setErrorHandler(dwrErrorHandler);

My question is
how could I dump error message line by line, like printStackTrace() in java ?

Thanks.
Edward

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...