Well, let's suppose your code works...
If I try to catch any error thrown in Axapta (this, is, NOT thrown by me!!). it doesn't matter whatever error/exception it is, I'm not able to catch it in a COM session (but in human session, I can do so).
RaÃl Llorente PeÃa
AnÃlisis, Desarrollo e ImplementaciÃn en
Microsoft Bussiness Solutions-Axapta
OPEN SOLUTIONS
"Bayliss, Barry"
<[EMAIL PROTECTED]>
Enviado por: Axapta-Knowledge-Village@yahoogroups.com 15/04/2005 01:31
|
|
Try using
Throw exception::error instead of throw error(âââ).
From: Raul Llorente PeÃa/OPENSOLUTIONS [mailto:[EMAIL PROTECTED]
Sent: Thursday, 14 April 2005 8:25 PM
To: Axapta-Knowledge-Village@yahoogroups.com
Subject: [Axapta-Knowledge-Village] Why sentence try/catch is invisible for COM sessions in 2.5?
In 2.5, sentences blocks try/catch aren't managed by Axapta when session is a COM one.
Let's see this example code (doesn't matter wherever you put it to be executed);
TableErrors tableErrors; //A new table created, with only a string field called error.
try
{
throw error('Error!!');
}
catch (Exception::error)
{
info('The error has been catched');
tableerrors.error = 'one';
tableErrors.insert();
}
If this code is executed in an 'human' session, the user will see "Error!! The error has been catched", and then, when examining the table TableErrors, user will see that a new record has beeb created, with value 'one'.
But, when code is executed via COM (a COM session), the error is thrown but not managed, this is, no record in tableErrors will appear at all.
This is, it appears as if try/catch sentences were invisible to COM sessions. Why? Is there any workaround for this issue?
This is normal in 3.0, too?
RaÃl Llorente PeÃa
AnÃlisis, Desarrollo e ImplementaciÃn en
Microsoft Bussiness Solutions-Axapta
OPEN SOLUTIONS
Sharing the knowledge on Axapta.
Sharing the knowledge on Axapta.
Yahoo! Groups Links
- To visit your group on the web, go
to:
http://groups.yahoo.com/group/Axapta-Knowledge-Village/
- To unsubscribe from this group, send
an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Sharing the knowledge on Axapta.
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/Axapta-Knowledge-Village/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.