Author: ips
Date: 2008-12-17 15:52:41 -0500 (Wed, 17 Dec 2008)
New Revision: 75
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/bean/history/operation/OperationServerServiceImpl.java
Log:
display prettier failure message when an operation throws an UnsupportedOperationExcpetion
(fix for
https://jira.jboss.org/jira/browse/EMBJOPR-49 and
https://jira.jboss.org/jira/browse/SOA-792)
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/bean/history/operation/OperationServerServiceImpl.java
===================================================================
---
trunk/core/src/main/java/org/jboss/on/embedded/bean/history/operation/OperationServerServiceImpl.java 2008-12-16
20:13:35 UTC (rev 74)
+++
trunk/core/src/main/java/org/jboss/on/embedded/bean/history/operation/OperationServerServiceImpl.java 2008-12-17
20:52:41 UTC (rev 75)
@@ -60,15 +60,19 @@
public void operationFailed(String jobId, ExceptionPackage error, long
invocationTime, long completionTime)
{
- OperationHistory history = historyBean.getHistory(jobId);
- history.setStatus(OperationRequestStatus.FAILURE);
+ OperationHistory operationHistory = historyBean.getHistory(jobId);
+ operationHistory.setStatus(OperationRequestStatus.FAILURE);
if (error != null)
{
- history.setErrorMessage(error.getStackTraceString());
+ if
(error.getExceptionName().equals(UnsupportedOperationException.class.getName()))
+ operationHistory.setErrorMessage("The '" +
operationHistory.getOperationDefinition().getName()
+ + "' operation is not supported by Embedded Jopr: "
+ error.getMessage());
+ else
+ operationHistory.setErrorMessage(error.getStackTraceString());
}
else
{
- history.setErrorMessage("Failed for an unknown reason at " + new
Date(completionTime));
+ operationHistory.setErrorMessage("Failed for an unknown reason at "
+ new Date(completionTime));
}
}
@@ -81,5 +85,4 @@
history.setErrorMessage("Timed Out");
}
}
-
}