how to throw a exception by DMI calling?

How can I throw a exception by server side method to client by DMI calling?

See the docs for handleError - if you indicate failure on the server side (negative value for setStatus()) and setData() to a String, that String will be shown in an alert dialog on the client by default.

sounds good

Then how can I catch the error?
I want not only show the message on client side by a message box, but also get the error by client code and handle the error.
How can I deal with this?
If you gimme some instantiation code,that’s great!
like
How to assemble a error message and send back to client?
How to catch and deal with the error message from client side?

Hi Tony,

All of this information is in the docs for handleError which you were just referred to, as well as the Server JavaDoc.