Exemplo n.º 1
0
        static public void throwException(int codErrorSap)
        {
            string strErrorMessage = "";

            if (objException == null)
            {
                objException = new B1Exception();
            }

            try
            {
                if (codErrorSap != 0)
                {
                    string mensagem = "";
                    B1AppDomain.Company.GetLastError(out codErrorSap, out mensagem);
                    strErrorMessage = codErrorSap + " :: " + mensagem;

                    writeLog(strErrorMessage);
                }
            }
            catch (Exception objEx)
            {
                writeLog("ExceptionClass:" + ": " + objEx.Message);
            }
        }
Exemplo n.º 2
0
        static public void throwException(string strAssembly, Exception er)
        {
            string strErrorMessage = "";

            if (objException == null)
            {
                objException = new B1Exception();
            }

            try
            {
                if (er != null && er.Message.Length > 0)
                {
                    System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace(er, true);
                    string strGetAssemblyInfo           = "Method:" + trace.GetFrame(0).GetMethod().Name + " Line: " + trace.GetFrame(0).GetFileLineNumber() + " Column: " + trace.GetFrame(0).GetFileColumnNumber();
                    strErrorMessage = strAssembly + "-" + strGetAssemblyInfo + " ::: " + er.Message;
                }
                else
                {
                    strErrorMessage = strAssembly;
                }

                writeLog(strErrorMessage);
            }

            catch (Exception objEx)
            {
                writeLog("ExceptionClass:" + strAssembly + ": " + objEx.Message);
            }
        }