zoukankan      html  css  js  c++  java
  • AX 2012 解析CLR Object 抛出的错误

    案例:

    AifUtil::getClrErrorMessage()

    public static str getClrErrorMessage()
    {
        #File
        str exceptionMessage;
        System.Exception exObject, innerException;
        ;
    
        new InteropPermission(InteropKind::ClrInterop).assert();
    
        // BP deviation documented
        exObject = CLRInterop::getLastException();
        if(exObject)
        {
            // We will ignore the first message since it is always a fixed message of
            // "Exception has been thrown from target of invocation", this is from the reflection API being used
            // "ClrObject could not be created." - This is also of no use in most cases
            innerException = exObject.get_InnerException();
            while(innerException)
            {
                // BP deviation documented
                exceptionMessage = exceptionMessage + #delimiterSpace + CLRInterop::getAnyTypeForObject(innerException.get_Message());
                innerException = innerException.get_InnerException();
            }
        }
    
        CodeAccessPermission::revertAssert();
    
        return exceptionMessage;
    
    }
    

      

  • 相关阅读:
    Spark2 Dataset DataFrame空值null,NaN判断和处理
    Spark2 文件处理和jar包执行
    &与&&, |与||区别
    Scala实现乘法口诀
    Hive desc
    Hive FUNCTIONS函数
    Hive show
    MySQL行列转换拼接
    MySQL字符串连接
    SQLServer之索引简介
  • 原文地址:https://www.cnblogs.com/sxypeace/p/14103053.html
Copyright © 2011-2022 走看看