Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353665

Summary: Support system exceptions
Product: z_Archived Reporter: Matt Heitz <mheitz>
Component: EDTAssignee: Project Inbox <edt.mofmodel-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: greer, jeffdouglas
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Matt Heitz CLA 2011-08-02 16:32:29 EDT
Support system exceptions - NullValueException, TypeCastException, etc.  Should they be built into the runtime or generated?
Comment 1 Jeff Douglas CLA 2011-08-09 21:59:04 EDT
Matt. These exceptions are used in the runtime, but have not been defined in the exceptions.egl source and generated into the language. Can you please do that (unless you want a different exception used)? I've taken care of the generators and runtime.

InvocationException (used with delegates)

NumericOverflowException (used with EDecimal and ESmallint)

JavaObjectException (used by EglAny.ezeCast)

TimestampFormatException (used by EString)

RuntimeException (used by many things)


I am not sure what fields you want in each of those exceptions, so let me know.
Comment 2 Matt Heitz CLA 2011-08-16 09:25:26 EDT
I'll make sure the types we need are defined in the .egl files.  I'm adding Scott to the CC list so he knows about the new guys.

I'll make the Java runtime changes too.

TimestampFormatException has been replaced in EDT by egl.lang.InvalidPatternException (a more general exception, to be used whenever pattern-based formatting or parsing fails).  I'll update the runtime to use InvalidPatternException.

We're trying hard to avoid including RuntimeException in EDT, so I'm not going to define it.  Its use in RBD isn't very clean: sometimes we have specific exceptions for problems, and sometimes we don't.  So people might code "onException(r RuntimeException)" and think that they'll catch every kind of exception, but it doesn't work that way.  And, when you catch RuntimeExceptions it's not very easy to write logic that varies depending on the underlying problem.

So, in EDT if you want to catch everything, put AnyException in your onException block.  And when there's an error we'll throw something specific to the problem.
Comment 3 Matt Heitz CLA 2011-08-16 18:35:56 EDT
The new exceptions have been added.  I also put in a few new fields so our exceptions can provide additional information:
  ArraySizeException.size
  InvalidIndexException.index
  InvalidPatternException.pattern
Comment 4 Matt Heitz CLA 2011-09-08 13:56:30 EDT
Closing.