Commit 7ba33dd2 authored by vvengurlekar's avatar vvengurlekar

ReceiptAdvConf.java- Not showing proper error msg shows invoation exception...

ReceiptAdvConf.java- Not showing proper error msg shows invoation exception error in all case(Reported by Tyson)


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@194170 ce508802-f39f-4f6c-b175-0d175dae99d5
parent df9e6a99
......@@ -21,6 +21,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.text.*;
......@@ -33,23 +34,37 @@ import javax.ejb.Stateless;
@Stateless
public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLocal,ReceiptAdvConfRemote
{
FinCommon Fcommon = new FinCommon();//Added by sarita on 23 NOV 2018
public String confirm(String tranID,String xtraParams, String forcedFlag) throws RemoteException,ITMException
{
String retString = "";
boolean isConn= false;
Connection conn = null;
boolean isPreview = false;
try
{
retString = confirm( tranID, xtraParams, forcedFlag, conn ,isPreview);
System.out.println("retString--123 ["+retString+"]");
//Modified by Anjali R. on [05/10/2018][In case of success prompt,system should not throw exception][Start]
//if ( retString != null && retString.length() > 0 )
if ( retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0 )
//Commented by sarita on 23 NOV 2018 [START]
/*if ( retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0 )
//Modified by Anjali R. on [05/10/2018][In case of success prompt,system should not throw exception][End]
{
throw new Exception("Exception while calling confirm for tran Id:["+tranID+"]");
retString = itmDBAccessEJB.getErrorString("", ls_errcode, userId);
}*/
if (retString != null && retString.length() > 0 && retString.indexOf("<error>") > -1 )
{
return retString;
}
else if(retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0)
{
retString = getErrorXmlString(Fcommon, retString, tranID);
System.out.println("ReturnString : ["+retString+"]");
}
//Commented by sarita on 23 NOV 2018 [END]
}
catch(Exception exception)
{
......@@ -66,19 +81,30 @@ public class ReceiptAdvConf extends ActionHandlerEJB implements ReceiptAdvConfLo
{
String retString = "";
boolean isConn= false;
boolean isPreview = false;
try
{
retString = confirm( tranID, xtraParams, forcedFlag, conn ,isPreview);
System.out.println("retString--1234 [\"+retString+\"]");
//Modified by Anjali R. on [05/10/2018][In case of success prompt,system should not throw exception][Start]
//if ( retString != null && retString.length() > 0 )
if ( retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0 )
//Commented by sarita on 23 NOV 2018 [START]
/*if ( retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0 )
//Modified by Anjali R. on [05/10/2018][In case of success prompt,system should not throw exception][End]
{
throw new Exception("Exception while calling confirm for tran Id:["+tranID+"]");
}*/
if (retString != null && retString.length() > 0 && retString.indexOf("<error>") > -1 )
{
return retString;
}
else if(retString != null && retString.length() > 0 && retString.indexOf("VTCICONF3") < 0)
{
retString = getErrorXmlString(Fcommon, retString, tranID);
System.out.println("ReturnString : ["+retString+"]");
}
//Commented by sarita on 23 NOV 2018 [END]
}
catch(Exception exception)
{
......@@ -3797,5 +3823,18 @@ if(! isPreview)//if isPreview is false
return retVal;
}
//Added by sarita on 23 NOV 2018 [START]
private String getErrorXmlString(FinCommon Fcommon, String errString, String tranId) throws RemoteException, ITMException
{
System.out.println("errString.indexOf(\"<error\"): "+errString.indexOf("<error"));
if(errString.indexOf("<error")<1)
{
String[] errorCodeMsg = errString.split("\t");
System.out.println("errorCodeMsg: "+Arrays.toString(errorCodeMsg)+" Length: "+errorCodeMsg.length);
errString = Fcommon.getErrorXML(errorCodeMsg[1], errorCodeMsg[0], errorCodeMsg[0],tranId+" failed");
}
return errString;
}
//Added by sarita on 23 NOV 2018 [END]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment