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

Bug 325913

Summary: [acceleo] show line numbers of current position in template file
Product: [Modeling] Acceleo Reporter: Simon harrer <simon.harrer>
Component: CoreAssignee: Project Inbox <acceleo-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: laurent.goubet
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Exception log none

Description Simon harrer CLA 2010-09-21 20:01:02 EDT
Build Identifier: 20100617-1415

Sometimes, there is no possibility to debug the code. Therefore, it would be great to have a more informative stack trace indicating in what line from which file the execution resulted in an error. This would help immensly. 

Reproducible: Always
Comment 1 Laurent Goubet CLA 2010-09-22 02:17:31 EDT
Hi Simon,

We already provide stack traces relative to the Acceleo templates. Did you stumble on an exception were we do not? Could you elaborate on the type of error for which we should provide more informative stack traces?
Comment 2 Simon harrer CLA 2010-09-22 07:04:03 EDT
Created attachment 179367 [details]
Exception log

Exception log which shows that no line number is shown during execution. 

However, this looks like it is a duplication of bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=290532
Comment 3 Laurent Goubet CLA 2010-09-22 07:15:17 EDT
Simon,

The exception itself is a duplicate ... but what you want isn't.

We provide "custom" exceptions with template-relative stack traces when the issue is "expected" : an Acceleo "for" loop with nothing to iterate over, an Acceleo "if" with a condition which is not a boolean ...

Yet when something unexpected comes up (such as a NullPointerException), we simply log the exception as it is without altering its stack trace to make it more "user-friendly".

This is an enhancement that could be made rather easily, I believe it will show up in the Indigo M3 (3.1.0M3) build due the ninth of November.
Comment 4 Laurent Goubet CLA 2011-01-25 10:21:48 EST
From 3.1.0M5 onward, RuntimeExceptions halting the evaluation of Acceleo modules are wrapped in custom exceptions providing both the "Acceleo specific" trace and the "Standard Java" trace.