try catch question

I’m using the following code for my try catch:

try { ... }
catch (e){
    var reason = e.rhinoException.getMessage();
}

This code does work, but it shows a warning buildmarker in Servoy 6: The property rhinoException is undefined in e
What is the correct notation for this in Servoy 6?

Jos

.rhinoException is really specific and sort of internal

but what you can do is:

var reason = e['rhinoException'].getMessage();

what is wrong with:

e.message 

not enough info?

jcompagner:
what is wrong with:

e.message 

not enough info?

ignorance on my part ;)
But when I use that code it also gives me a warning buildmarker:
The property message is undefined in e

try { ... }
catch (e){
    var reason = e.message;
}

Jos

yes, that will be fixed in a next release of servoy.
now an exception object that you have in the catch(e) block will have 2 properties: name and message

Hi Johan!

jcompagner:
yes, that will be fixed in a next release of servoy.

Is it fixed in 6.0.1?

jcompagner:
now an exception object that you have in the catch(e) block will have 2 properties: name and message

I’m sorry, but this is not really clear for me. Would you please so kind to explain it a little bit more? How should be the type declaration for the catch(e)?

yes this is fixed in 6.0.1

if you do this:

try {

}
catch(e) {
e.
}

then you see you will have code completion behind e.

Servoy typed ‘e’ for you

jcompagner:
then you see you will have code completion behind e.

Servoy typed ‘e’ for you

I’m on Servoy 6.0.1 and I have tried this in a new method, but I get no code completions behind the e.!? Except the error ‘No completions available’.

yes you are right, that fix was done on 31/8 but the dltk build servoy 6.0.1 uses is from 25/8, so it didn’t came in this release.