Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354563 - Enhance error messages when an exception occurs
Summary: Enhance error messages when an exception occurs
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-11 18:49 EDT by Joseph Vincens CLA
Modified: 2017-02-23 14:16 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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