Catch a warning message from aif web service

I have aif service in ax 2012 . I pass information from .net applications into it. basically i post to the general log. But when there is an error, let's say that bad information is transmitted, it returns a general error, usually โ€œerror checkingโ€ . But the warning message displays the actual reason that it caused the error, for example, bad data.

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

 catch (Exception::Error) { throw Global::error("need to get warning"); } 
+5
source share
3 answers

From memory, but you tried:

throw error(AifUtil::getClrErrorMessage());

0
source

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

0
source

I hope to raise a question.

If you ant receive all the warning message from Infolog, I have a small solution. You can take all the Infolog created by the system, look like this:

 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 doesn't exactly request, but in this way the entire InfoLog and warning can also be displayed.

Good job.

Links: Infolog-INFO - Infolog2String

0
source

Source: https://habr.com/ru/post/1265006/


All Articles