catching the warning message from aif web service

感情迁移 提交于 2019-12-23 10:16:33

问题


I have a aif service in ax 2012. I pass information into it from .net applications. basically i'm posting to the general journal. But when there is an error, say bad information being passed in, it returns a general error usually "error validating record". But the warning message displays the actual reason why it caused an error such as the bad data.

Is there a way to catch and display the warning message. I tried exception::warning but it just goes right to the exception::error.

catch (Exception::Error)
{
    throw Global::error("need to get warning");
}

回答1:


I hope to understok the question.

If you ant get all Warning message from Infolog, I have a little solution. You can take all Infolog created by system, look like :

InfologData             msg;
catch (Exception::Error)
{
     msg = infolog.infologData();
     infolog.import(msg); // HERE show all infolog - with INFO - Warning - Errors
     throw Global::error("Process Error");
}

It's not exactly request, but with this way can find all InfoLog displayed and warning too.

Good Work.

References : Infolog-INFO - Infolog2String




回答2:


From memory, but have you tried:

throw error(AifUtil::getClrErrorMessage());




回答3:


Perhaps this can help throw error(CLRInterop::getLastException().ToString());



来源:https://stackoverflow.com/questions/42587796/catching-the-warning-message-from-aif-web-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!