How do I use ServoyException?

Hi all,

in version 3.0 there is a new item in the method editor tree called ServoyException. There is even a nice piece of sample code, but where do I attache this code? Can’t seem to find any info on the forum or in the online help…

Did you check the new example solutions?
They should be in your Solutions/Examples directory.

Christian,

You should have been at ServoyWorld… :D

Just create a method and move the sample code - all will be revealed…

Cheers

bcusick:
all will be revealed…

Hi Bob, it would be great to reveal some more detail on practical uses of the ServoyExceptions node.

For example, how is the ServoyException.INCORRECT_LOGIN applied? An error caused by
security.login(“fred”, “xxx” , groups)
doesn’t trigger the error trap method.

What’s the purpose of the property .isServoyException ? The manual (section 7.17) suggests that all the listed error codes are servoy exceptions, so under what circumstances will .isServoyException return ‘false’?

Which of the listed errors are considered data exceptions?

For readers of this thread, here’s a list of the numeric codes returned by the .getErrorCode() property.

106 - ACQUIRE_LOCK_FAILURE
102 - BAD_SQL_SYNTAX
105 - DATA_ACCESS_RESOURCE_FAILURE
101 - DATA_INTEGRITY_VIOLATION
104 - DEADLOCK
311 - EXECUTE_PROGRAM_FAILED
312 - INCORRECT_LOGIN
309 - INVALID_INPUT
107 - INVALID_RESULTSET_ACCESS
320 - NO_ACCESS
323 - NO_CREATE_ACCESS
322 - NO_DELETE_ACCESS
307 - NO_LICENSE
319 - NO_MODIFY_ACCESS
324 - NO_RELATED_CREATE_ACCESS
103 - PERMISSION_DENIED
308 - RECORD_LOCKED
330 - SAVE_FAILED
100 - UNKNOWN_DATABASE_EXCEPTION

Is it possible at runtime to determine current method and line when the exception occurred? I’m writing an error trap emails me with as much detail as possible about the cause of the error.

As far as I know, this is not possible. But that’s a really good feature request, I asked for that a while ago with something similar in mind…

Just entered it into the support system as a feature request. Ticket 61495