zoukankan      html  css  js  c++  java
  • Hot to catching ClrErrors in Dynamics AX

    CLRError
    // BP Deviation documented
    static utcDatetime THK_UTCDatetime(name    _datetimeStr)
    {
        utcDatetime         dt;
        InteropPermission   permission;
        name                datetimeStr = strlrTrim(_datetimeStr);
        System.Exception    ex;
        str                 ClrErrCatch;
    ;
        try
        {
            //Necessary if executed on the AOS
            permission = new InteropPermission(InteropKind::ClrInterop);
            permission.assert();
            if(permission && datetimeStr)
                // BP Deviation documented
                dt = CLRInterop::getAnyTypeForObject(System.DateTime::Parse(datetimeStr));
            else
                dt = dateTimeUtil::minValue();
        }

        catch (Exception::ClrError)
        {
            ex = ClrInterop::getLastException();
            if (ex != null)
            {
                ClrErrCatch  = ex.get_Message();
                ClrErrCatch += ex.get_StackTrace();
                ex = ex.get_InnerException();
                if (ex != null)
                {
                    ClrErrCatch += ex.ToString();
                }
            }
            throw error(ClrErrCatch);
        }
        catch(exception::Error)
        {
            throw Error(strfmt("error %1 [%2]",funcName(),_datetimeStr));
        }
        ////Revert CAS back to normal
        CodeAccessPermission::revertAssert();
        return dt;
    }
  • 相关阅读:
    owe的用法
    other,others,another,the other的区别
    国内顶尖的sql dba 团队招人。
    Sqler 工具更新
    2015 年个人计划
    在没Hadoop 、GP 前提下怎么进行实时数据统计。
    201407-至今
    Sqler-Cmd
    Sqler-Monitor
    SqlCmd -Windows Cluster Model
  • 原文地址:https://www.cnblogs.com/Fandyx/p/2461472.html
Copyright © 2011-2022 走看看