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

Bug 354563

Summary: Enhance error messages when an exception occurs
Product: z_Archived Reporter: Joseph Vincens <jvincens>
Component: EDTAssignee: Project Inbox <edt.genframework-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: lasher
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Joseph Vincens CLA 2011-08-11 18:49:30 EDT
Include the part[file](line #) that caused the exception
Comment 1 Joseph Vincens CLA 2011-08-12 07:45:27 EDT
Before printing the stack trace I changed the code to output the part[file name](line #)
Comment 2 Joseph Vincens CLA 2011-08-12 15:07:56 EDT
move this code to the framework so it's available to all generators.
Comment 3 Joseph Vincens CLA 2011-08-12 15:57:45 EDT
The EGLContext now contains a field to store the last EGL_Location. All JavaGen and JavaScriptGen statements pass through ReorganizeCode.reorgCode, in this method I get the EGL_Location Annotation from the statement and write it to the context.
In all locations that were using EGLMessage.createMessage, if there is a context available I do EGLContext.getLastStatementLocation which is the current statement that is being generated. 

This causes the error markers to appear on the EGL line that caused the generation exception. 

I use the same annotation information when we print a stacktrace. Before we output the stack trace we will output generating:<fully qualified part name>[<part's file name>](line #).

If the exception occurs while in pregen or when generating special (non user functions or fields) the line number will be 0 because we have not started processing statements.
Comment 4 Lisa Lasher CLA 2011-08-26 18:04:56 EDT
changing to Enhancement, as this isn't really a defect.
Comment 5 Joseph Vincens CLA 2011-09-12 13:01:52 EDT
verified