* 58, 60, 61, 62, 63, 64, 67, 68, 69, 70, 71, 72, 73<br>
* <p>
* @return GenericException
*/
public GenericException getException() {
GenericException e = null;
int severity = Constants.SP_ER_ERROR;
int reasonCode = 0;
String message = null;
TextData key = null, status = null;
DataValue p1 = null, p2 = null;
if (this.getMsgSetID() == 0) {
this.setMsgSetID(Error.SVC_MSGSET_ID);
}
if (this.getParam1() != null && this.getParam1() instanceof DataValue) {
p1 = (DataValue)this.getParam1();
}
if (this.getParam2() != null && this.getParam2() instanceof DataValue) {
p2 = (DataValue)this.getParam2();
}
if (this.getOriginator() != null && this.getOriginator() instanceof BusinessClass) {
status = ((BusinessClass)this.getOriginator()).statusAsTextData();
if (((BusinessClass)this.getOriginator()).getInstanceKey() != null) {
key = ((BusinessClass)this.getOriginator()).getInstanceKey().asTextData();
}
}
else if (this.getParam1() != null && this.getParam1() instanceof BusinessClass) {
status = ((BusinessClass)this.getParam1()).statusAsTextData();
if (((BusinessClass)this.getParam1()).getInstanceKey() != null) {
key = ((BusinessClass)this.getParam1()).getInstanceKey().asTextData();
}
}
reasonCode = Constants.SP_ER_INVALIDSTATE;
if (this.getError() > 300) {
reasonCode = 0;
}
else if ((this.getError()&1) > 0) {
reasonCode = Constants.SP_ER_PARAMETERERROR;
}
message = this.getCatalogMessage(this.getError());
if (message == null) {
e = new UsageException();
if (this.getParam2() != null) {
message = this.getCatalog().getString(this.getMsgSetID(), 75, this.getMessage(75));
}
else if (this.getParam1() != null) {
message = this.getCatalog().getString(this.getMsgSetID(), 76, this.getMessage(76));
}
else {
message = this.getCatalog().getString(this.getMsgSetID(), 77, this.getMessage(77));
}
}
if (this.getMsgSetID() == Error.SVC_MSGSET_ID) {
switch (this.getError()) {
case Error.GEN_UNIMPLEMENTED: {
e = new ImplementationException();
if (this.getParam1() != null) {
this.setParam2(this.getParam1());
message = this.getCatalog().getString(this.getMsgSetID(), 2, this.getMessage(2));
}
if (this.getMethodName() == null) {
p1 = new TextData(this.getCatalog().getString(this.getMsgSetID(), 3, this.getMessage(3)));
}
else {
p1 = new TextData(this.getMethodName());
}
break;
}
case Error.B_CANT_DELETE: {
p1 = key;
p2 = status;
break;
}
case Error.B_CANT_UPDATE: {
p1 = key;
p2 = status;
break;
}
case Error.B_ILLEGAL_ATTR: {
p1 = key;
break;
}
case Error.B_INCONSISTENT_STATE: {
e = new ImplementationException();
p1 = key;
p2 = status;
if (this.getOriginator() != null && this.getOriginator() instanceof BusinessClass) {
if (((BusinessClass)this.getOriginator()).getUpdateQuery() == null) {
message = this.getCatalog().getString(this.getMsgSetID(), 8, this.getMessage(8));
}
else {
message = this.getCatalog().getString(this.getMsgSetID(), 9, this.getMessage(9));
}
}
break;
}
case Error.BC_NOT_REVERTABLE: {
this.setParam1(this.getOriginator());
break;
}
case Error.BC_CANNOT_REVERT: {
this.setParam1(this.getOriginator());
break;
}
case Error.BC_CANNOT_SAVE: {
p1 = key;
p2 = status;
break;
}
case Error.BC_TOO_LATE_TO_SAVEFORREVERT: {
p1 = key;
p2 = status;
break;
}
case Error.BM_NO_UPDATE: {
if (this.getParam1() != null && this.getParam1() instanceof BusinessKey) {
p1 = ((BusinessKey)this.getParam1()).asTextData();
}
if (this.getParam2() == null) {
p2 = new TextData();
}
break;
}
case Error.BS_UNKNOWN_BM: {
p2 = new TextData(this.getOriginator().getClass().getSimpleName());
break;
}
case Error.CM_CLASS_CHANGED: {
e = new ExpressConcurrencyException(reasonCode);
if (this.getParam1() != null && this.getParam1() instanceof BusinessKey) {
p1 = ((BusinessKey)this.getParam1()).asTextData();
}
if (this.getParam2() == null) {
p2 = new TextData();
}
break;
}
case Error.CM_AGGREGATE_CHANGED: {
if (key != null) {
p1 = key;
}
else {
p1 = this.getCatalog().getTextData(this.getMsgSetID(), Error.NIL_PARAMETER, new TextData(this.getMessage(Error.NIL_PARAMETER)));
}
break;
}
case Error.CM_NO_ORIGINAL: {
if (this.getParam1() != null && this.getParam1() instanceof BusinessQuery && ((BusinessQuery)this.getParam1()).getKey() != null) {
p1 = ((BusinessQuery)this.getParam1()).getKey().asTextData();
}
else {
p1 = this.getCatalog().getTextData(this.getMsgSetID(), Error.NIL_PARAMETER, new TextData(this.getMessage(Error.NIL_PARAMETER)));
}
break;
}
case Error.CM_KEY_NOT_UNIQUE: {
if (this.getParam1() != null && this.getParam1() instanceof BusinessKey) {
p1 = ((BusinessKey)this.getParam1()).asTextData();
}
else {
p1 = this.getCatalog().getTextData(this.getMsgSetID(), Error.NIL_PARAMETER, new TextData(this.getMessage(Error.NIL_PARAMETER)));
}
break;
}
case Error.CM_NEGATIVE_REF_COUNT: {
if (this.getParam2() != null && this.getParam2() instanceof BusinessKey) {
p2 = ((BusinessKey)this.getParam2()).asTextData();
}
else {
p2 = this.getCatalog().getTextData(this.getMsgSetID(), Error.NIL_PARAMETER, new TextData(this.getMessage(Error.NIL_PARAMETER)));
}
break;
}
case Error.CM_DROPPING_LOCKED_KEY: {
if (this.getParam2() != null && this.getParam2() instanceof BusinessKey) {
p2 = ((BusinessKey)this.getParam2()).asTextData();
}
else {
p2 = this.getCatalog().getTextData(this.getMsgSetID(), Error.NIL_PARAMETER, new TextData(this.getMessage(Error.NIL_PARAMETER)));
}
break;
}
}
}
if (e == null) {
e = new UsageException(reasonCode, UsageException.qq_Resolver.cREASONCODE);
}
if (p1 == null && this.getParam1() != null) {
if (this.getParam1() instanceof DataValue) {
p1 = (DataValue)this.getParam1();
}
else {
p1 = new TextData(this.getParam1().getClass().getSimpleName());
}
}
if (p2 == null && this.getParam2() != null) {
if (this.getParam2() instanceof DataValue) {
p2 = (DataValue)this.getParam2();
}
else {
p2 = new TextData(this.getParam2().getClass().getSimpleName());
}
}
e.setWithParams(severity, new TextData(message), p1, p2);
TextData detectingMethod = new TextData();
if (this.getOriginator() != null) {
detectingMethod.concat(this.getOriginator().getClass().getSimpleName());
detectingMethod.concat(this.getCatalog().getString(this.getMsgSetID(), 78, this.getMessage(78)));
}
else {
detectingMethod.concat(this.getCatalog().getString(this.getMsgSetID(), 79, this.getMessage(79)));
}
if (this.getMethodName() != null) {
detectingMethod.concat(this.getMethodName());
}
else {
detectingMethod.concat(this.getCatalog().getString(this.getMsgSetID(), 80, this.getMessage(80)));
}
e.setDetectingMethod(detectingMethod.toString());
if (LogMgr.getInstance().test(Constants.SP_MT_CONFIGURATION, Constants.SP_ST_EX, Trace.CFG_ADDSTACKTRACE, 1) && !(LogMgr.getInstance().test(Constants.SP_MT_CONFIGURATION, 2, 1, 1))) {
e.getMessageText().concat(FrameworkUtils.traceBack());
}
ErrorMgr.addError(e);
return e;