Author |
Topic: IndexOutOfRangeException at OEC.API.Bases.ValueList`1.get_Item(Int32 index) (5 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
CZendejas116 Posts: 51 Joined: Apr 13, 2011 |
Hi,
I have this code: try And I'm managing unhandled exceptions in Main method as follows: AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(GenericUnhandledException); But I'm getting this exception, right in line where I call method1, instead of getting into catch block or into GenericUnhandledException method: IndexOutOfRangeException. Index was outside the bounds of the array. In a past topic (http://www.openecry.com/cfbb/index.cfm?page=topic&topicID=547), VictorV said that all exceptions into API.dll are handled, but with this, I think API.dll is not handling IndexOutOfRangeException. Any Suggestions to handle this exception? Regards, Claudia Zendejas |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
Hi,
As I see from your code the referred condition is not satisfied: "if the origin of stack trace is inside OECAPI instance". In your code the origin of stack is System.Threading.Tasks.Task.Execute() method. Victor Vins Lead Software Developer |
||||
CZendejas116 Posts: 51 Joined: Apr 13, 2011 |
Hi,
If we have this code: using System; We obtain this stacktrace: at TestExceptionBehaviour.Program.method3() in D:\samples\TestExceptionBehaviour\TestExceptionBehaviour\Program.cs:línea 25 So, first line in a stacktrace is where exception occurs. Same case for stacktrace in my initial post in this thread: StackTrace: Example in MSDN from Microsoft: http://msdn.microsoft.com/en-us/library/system.exception.stacktrace.aspx#Y694 In addition, I attach a screenshot in which we can see that Visual Studio indicates that exception was originated in API.dll: - Claudia Zendejas |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
I feel you misunderstood "origination of stack trace" and "origination of exception". In my comment I mentioned that OECAPI handles exceptions, if stack trace is originated in OECAPI. For example, event handler doesn't catch exceptions. In your case, OECAPI will not catch this exception by design, this is a responsibility of custom application to handle them to figure out errors in the applications.
Victor Vins Lead Software Developer |
||||
CZendejas116 Posts: 51 Joined: Apr 13, 2011 |
Yes, I misunderstood your comments
Claudia Zendejas |
||||