Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Acceleo: Custom Exception handler for IO exceptions(How to detect if a file wasn't written)
Acceleo: Custom Exception handler for IO exceptions [message #1846986] Mon, 11 October 2021 11:43 Go to next message
Thomas Barth is currently offline Thomas BarthFriend
Messages: 22
Registered: March 2021
Junior Member
Hi,

because some GIT diff tools lock files, I have to detect if files have not been generated by Acceleo.

In the debugger console I get a corresponding message:
 !MESSAGE Could not create file <path>


However, I need to notify the user within the application. So either I need a way to catch the exception or I need to redirect the console output.

doGenerate
apparently catches the Exception internally and the listeners seem to only report successful generations.
Re: Acceleo: Custom Exception handler for IO exceptions [message #1846990 is a reply to message #1846986] Mon, 11 October 2021 13:37 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7680
Registered: July 2009
Senior Member
Hi

You can override doGenerate with a more suitable implementation.

If such an implementation is of general use you can contribute it to the Acceleo project.

Regards

Ed Willink
Re: Acceleo: Custom Exception handler for IO exceptions [message #1847091 is a reply to message #1846990] Thu, 14 October 2021 10:22 Go to previous messageGo to next message
Thomas Barth is currently offline Thomas BarthFriend
Messages: 22
Registered: March 2021
Junior Member
Hi Ed,

for now I solved this issue by comparing the events handled by filePathComputed with the ones handled by fileGenerated.

Newbie question...
How would I look into the source of acceleo?
I found https://git.eclipse.org/c/acceleo/org.eclipse.acceleo.git/ but the namespace im interested in (org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator) seems not be in there.

[Updated on: Thu, 14 October 2021 10:22]

Report message to a moderator

Re: Acceleo: Custom Exception handler for IO exceptions [message #1847093 is a reply to message #1847091] Thu, 14 October 2021 11:44 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7680
Registered: July 2009
Senior Member
Hi

The relevant source is auto-generated in your project.

Acceleo source more generally are available by
Browsing https://git.eclipse.org/r/plugins/gitiles/acceleo/org.eclipse.acceleo
Import->PDE->Plugins and Fragments
Checking out plugins from the Acceleo GIT
Using OOMPH to create an Acceleo development installation

Regards

Ed Willink
Re: Acceleo: Custom Exception handler for IO exceptions [message #1847094 is a reply to message #1847093] Thu, 14 October 2021 12:03 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7680
Registered: July 2009
Senior Member
Hi

Reviewing your initial paragraphs, I am very sceptical about what you are doing.

There should be no difference between an Acceleo generated file and any other. Who knows what tool you may use next? Will another bodge be needed?

!MESSAGE Could not create file <path>


May well be related to the problem, but it is not the kind of thing I ever handle; it is bad news from deep within the Eclipse platform.

I suggest that your real problem is that you have stale locks that need fixing, or you need some kind of please-wait dialog for your impatient users.

Regards

Ed Willink
Re: Acceleo: Custom Exception handler for IO exceptions [message #1847095 is a reply to message #1847094] Thu, 14 October 2021 12:36 Go to previous messageGo to next message
Thomas Barth is currently offline Thomas BarthFriend
Messages: 22
Registered: March 2021
Junior Member
Hi Ed,

I'm afraid I wasn't too precise with my problem description.
The problem I want to tackle is not related to the internal source file generation of acceleo but to the files generated by acceleo using the AQL file tag in the .mtl files.
Re: Acceleo: Custom Exception handler for IO exceptions [message #1847100 is a reply to message #1847095] Thu, 14 October 2021 15:17 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7680
Registered: July 2009
Senior Member
Hi

I'm afraid your 'new' information conveys exactly zero to me apart from the mention of AQL about which I know almost nothing.

Regards

Ed Willink
Previous Topic:Generate text on Annotation
Next Topic:Acceleo & Maven Repository Missing Artifacts
Goto Forum:
  


Current Time: Mon Dec 02 08:12:37 GMT 2024

Powered by FUDForum. Page generated in 0.03210 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top