Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] syntax for raise (and try except)
[QVTO] syntax for raise (and try except) [message #496418] Mon, 09 November 2009 23:49 Go to next message
Eclipse UserFriend
Originally posted by: vanbeerst.gmail.com

Hi I was wondering what the syntax was for the raise construct. I notice
that the QVTO editor recognises the string 'raise' as a keyword, but
everytime I try to use it, I get the message : 'raise' misplaced construct.

I use it like this ...
if(not someBoolean)
then
{
raise "myexception";
}
endif;

.... or like this
if(someBoolean)
then
{
// do something
}
else raise "myexception"
endif;

Is there something wrong with this?

I also get error messages when trying the try .. except thing :
try
{
// do something
}
except("myexception")
{
// do something
};

This time the errors says :
- token 'try' is invalid
- ';' expected instead of 'except'
- collectionTypeIdentifierCS expected instead of '("myexception")'

Regards,
Tony.
Re: [QVTO] syntax for raise (and try except) [message #496536 is a reply to message #496418] Tue, 10 November 2009 13:14 Go to previous message
Eclipse UserFriend
Originally posted by: dvorak.radek.gmail.com

Hi Tony,

try-catch handling is not yet implemented.
Though, I don't think it's a good idea to start messing up transformations
with exceptions,
we want to support it in Helios, just to be complete.

Just a hint, if you only want to interrupt a transformation execution like
an
unhandled exception would do, use assertion with fatal severity:

assert fatal (<myCondition>);

In case you need to catch and process the exception in a custom way, it's
not yet possible.

Regards,
/Radek



On Tue, 10 Nov 2009 00:49:08 +0100, Tony Van Beers <vanbeerst@gmail.com>
wrote:

> Hi I was wondering what the syntax was for the raise construct. I notice
> that the QVTO editor recognises the string 'raise' as a keyword, but
> everytime I try to use it, I get the message : 'raise' misplaced
> construct.
>
> I use it like this ...
> if(not someBoolean)
> then
> {
> raise "myexception";
> }
> endif;
>
> ... or like this
> if(someBoolean)
> then
> {
> // do something
> }
> else raise "myexception"
> endif;
>
> Is there something wrong with this?
>
> I also get error messages when trying the try .. except thing :
> try
> {
> // do something
> }
> except("myexception")
> {
> // do something
> };
>
> This time the errors says :
> - token 'try' is invalid
> - ';' expected instead of 'except'
> - collectionTypeIdentifierCS expected instead of '("myexception")'
>
> Regards,
> Tony.
Previous Topic:[Query] Defining the meta model
Next Topic:Help on QVT (M2M)
Goto Forum:
  


Current Time: Mon Aug 19 22:36:35 GMT 2019

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

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

Back to the top