Flex也可以在生产模式下获取错误消息

问题描述 投票:1回答:0

我正在Flex 4.6中构建一个应用程序,该应用程序在运行时会加载很多东西。 这些东西将由最终用户放置。 在所有这些文件之间,有一个手写的xml文件。

在这种情况下,文件可能无效(关闭标签与开始标签不同,等等)。 如果有问题,Flex会引发一个错误,可以捕获。

实际上,我在弹出窗口中显示错误消息,并且一切正常……仅在IDE(Flash Builder 4.6)中。 在构建并安装要测试的发行版时,我得到错误ID而不是错误消息。

这怎么可能 ?

这是我使用的代码。

private function loadXML(file:ByteArray = null):void
{
    if(file){
        try{
            // Parse the xml file
            var data:XML = new XML(file.toString());

            ... some code ...

        }catch(e:Error){
            Alert.show("Cannot parse the xml file. " + e.message);
        }
    }else{
        Alert.show("No xml file.");
    }
}

这是我在ide中获得的内容(调试和发布模式):

Cannot parse the xml file. Error #1085: The element type "textc" must be terminated by the matching end-tag "</textc>".

这是我通过发行版获得的内容:

Cannot parse the xml file. Error #1085

为什么消息在发行版本中发生更改,我如何保留此消息?

apache-flex actionscript error-handling flex4.6
© www.soinside.com 2019 - 2024. All rights reserved.