[QVTO] syntax for raise (and try except) [message #496418] |
Mon, 09 November 2009 23:49 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03070 seconds