Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

catching the warning message from aif web service

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");
}
like image 664
Sirus Avatar asked Nov 09 '22 01:11

Sirus


1 Answers

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

like image 79
ulisses Avatar answered Jan 04 '23 03:01

ulisses