Kbase P103855: How to get more information from a MgmtException
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/3/2005 |
|
Status: Unverified
GOAL:
How to get more information from a MgmtException
GOAL:
How to debug issue related to the Management Framework API ?
GOAL:
How to block to iterate through any exceptions nested within a SonicMQ MgmtException or MFException ?
FIX:
This is a template code that can be used in a catch block to iterate through any exceptions nested within a SonicMQ
MgmtException or MFException.
Wrap the following code that triggers the MgmtException or MFException in the
following try/catch block, or similar:
// Add the following import to the start of the java file
// (alternatively, fully-qualify these class names in the
// code shown below)
import com.sonicsw.mf.common.MFException
import com.sonicsw.ma.mgmtapi.config.MgmtException
// Wrap the code that uses the Management Framework API
// in the following try/catch block...
try {
...user code here...
} catch (Throwable e) {
while (e != null) {
e.printStackTrace();
if (e instanceof MFException) {
e = ((MFException)e).getLinkedException();
} else if (e instanceof MgmtException) {
e = ((MgmtException)e).getLinkedException();
} else {
e = null;
}
if (e != null) System.err.println("Caused by:");
}
}
If necessary the 'else if' construct can be extended to take account
of additional exception types containing nested exception information.