d62edc458cca7366f04c44fca189c0ee58582d91.svn-base 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package xin.glue.ui.G.G02;
  2. import com.posdata.glue.PosException;
  3. import com.posdata.glue.biz.activity.PosActivity;
  4. import com.posdata.glue.biz.constants.PosBizControlConstants;
  5. import com.posdata.glue.context.PosContext;
  6. import com.posdata.glue.dao.PosDaoException;
  7. public class PosErrorHandler extends PosActivity
  8. {
  9. public String runActivity(PosContext ctx)
  10. {
  11. System.out.println("XinHandleError runActivity START...");
  12. String message = "";
  13. Throwable th = ctx.getException();
  14. System.out.println("XinHandleError getMessages:"+ctx.getMessages());
  15. // System.out.println("XinHandleError SearchSlabCutting:"+ctx.getGlueProperty("resultkey"));
  16. // System.out.println("XinHandleError getBeanFactory:"+ctx.getBeanFactory());
  17. // System.out.println("XinHandleError getAllRequestAttrs:"+ctx.getBeanFactory());
  18. System.out.println("XinHandleError getAllRequestParameters:"+ctx.getAllRequestParameters());
  19. System.out.println("XinHandleError th:"+th);
  20. if (th != null)
  21. {
  22. if (th instanceof PosDaoException)
  23. {
  24. message = "DB connect ERROR ";
  25. }
  26. else if (th instanceof PosException)
  27. {
  28. message = " SYSTEM ERROR ";
  29. }
  30. ctx.setException(new PosException(message));
  31. }
  32. System.out.println("XinHandleError message:"+message);
  33. this.rollbackTransaction("tx1");
  34. return PosBizControlConstants.SUCCESS;
  35. }
  36. }