UniSubroutine Exception

894 Views Asked by At

I am getting following UniSubroutineException on following line of code while executing the Call() of UniSubroutine.

try
        {
            if ((txtEmail.Text != "") && (txtPass.Text != ""))
            {
                if (txtPass.Text == txtPass2.Text)
                {

                    Connection CONN = new Connection();
                    UniSession us = UniObjects.OpenSession(CONN.IP(), CONN.UNAME(), CONN.PASS(), CONN.ACCT());
                    UniFile PRACTICES = us.CreateUniFile("PRACTICES");
                    UniFile BCPARAMS = us.CreateUniFile("BC.PARAMS");
                    string OPRICE = BCPARAMS.ReadField("OPTIONS", 2).ToString();
                    if (OPRICE == "")
                    {
                        OPRICE = "19900";
                    }
                    UniSubroutine CHECKNEWEMAIL = us.CreateUniSubroutine("CHECK.NEW.EMAIL", 2);
                    CHECKNEWEMAIL.SetArg(0, txtEmail.Text);
                    CHECKNEWEMAIL.Call();
                    string ERSP = CHECKNEWEMAIL.GetArg(1).ToString();
                    if (ERSP == "")
                    {

                        UniDynArray IN = new UniDynArray(us);
                        IN.Replace(2, txtBName.Text);
                        IN.Replace(3, txtBAddr.Text);
                        IN.Replace(4, txtCity.Text);
                        if (ddCountry.SelectedValue == "US")
                        {
                            IN.Replace(6, txtZip.Text);
                        }
                        if (ddCountry.SelectedValue == "AU")
                        {
                            IN.Replace(5, txtState.Text);
                        }
                        IN.Replace(8, txtName.Text);
                        IN.Replace(9, txtEmail.Text.Replace(" ", ""));
                        IN.Replace(10, txtPass.Text);
                        IN.Replace(11, txtEmail.Text);
                        IN.Replace(12, "");
                        IN.Replace(20, "M");
                        IN.Replace(70, "NOT VERIFIED");
                        IN.Replace(86, "");
                        try
                        {
                            IN.Replace(25, ddHear.SelectedValue);
                        }
                        catch
                        {
                            IN.Replace(25, "");
                        }
                        IN.Replace(53, us.Iconv(DateTime.Now.AddDays(30).ToShortDateString(), "D2/"));
                        IN.Replace(54, OPRICE);
                        if (txtGroupNum.Text != "")
                        {
                            UniSubroutine GIDTOPID = us.CreateUniSubroutine("GID.TO.PID", 3);
                            GIDTOPID.SetArg(0, txtGroupNum.Text);
                            GIDTOPID.Call();
                            string PID = GIDTOPID.GetArg(1).ToString();
                            string PRICE = GIDTOPID.GetArg(2).ToString();
                            IN.Replace(86, PID);
                            IN.Replace(54, PRICE);
                        }
                        IN.Replace(90, ViewState["AFID"].ToString());
                        IN.Replace(115, ddCountry.SelectedValue);
                        IN.Replace(120, ViewState["CURR"].ToString());
                        string MVIN = IN.ToString();

                        UniSubroutine NEWUSER = us.CreateUniSubroutine("NEW.USER.V2", 3);
                        NEWUSER.SetArg(0, MVIN);
                        NEWUSER.Call();

                        string UID = NEWUSER.GetArg(1).ToString();

                        string SEC = Security.CreateSecurity(DateTime.Now.AddHours(8), UID);
                        Response.Redirect("Verify.aspx?SEC=" + SEC);
                    }
                    else
                    {
                        UniObjects.CloseSession(us);
                        lblMSGBox.Text = "Invalid Email Address";
                        RadNotification1.Show();
                    }
                }
                else
                {
                    lblMSGBox.Text = "Passwords do not match";
                    RadNotification1.Show();
                }
            }
            else
            {
                lblMSGBox.Text = "Email and Password are required";
                RadNotification1.Show();
            }
        }
        catch (Exception ex)
        {
        }
    }

Error: An exception of type 'IBMU2.UODOTNET.UniSubroutineException' occurred in UODOTNET.dll but was not handled in user code

Additional information: [Rocket U2][UODOTNET - UNICLIENT][ErrorCode=30107] The subroutine failed to complete successfully

Please suggest me how can I fix this issue.

1

There are 1 best solutions below

0
On

The additional information supplied is the clue

[Rocket U2][UODOTNET - UNICLIENT][ErrorCode=30107] The subroutine failed to complete successfully

This indicates that the subroutine you called failed to return: Either the subroutine encountered a STOP, or it's execution aborted.
The end result is that UniRPC connection did not get a graceful response to the subroutine call and threw an error for you to investigate.