Error capture when violating constraints...

Hi,

When I try to delete a record which is referenced by forreign key constraints in the database (Postgresql), A dialog box pops up and I get a java.SQLexception message back from the database. I’d like to display my own more user friendly message instead.

tried

application.setErrorCapture(true);
controller.deleteRecord();
var error = getLastErrorCode();
...

Error capture does not seem to work in this context… I still get the default Servoy dialog box :frowning:
Any ideas?

swingman:
Error capture does not seem to work in this context… I still get the default Servoy dialog box :-(
Any ideas?

In the current version you can’t hide the errors generated by the database. We are working on a major enhancement of the error handling in Servoy that will also take care of this.

Great!

swingman:
Great!

Swingman:

Maybe obvious, maybe not.

It would be nice to add this feature. In the mean time, there may be another way to handle this. You should be able to “precheck” the data in Servoy before attempting to allow Servoy to perform it’s default action and error handling. It’s always good to try to avoid DB generated errors in the first place, though, they will inevitably slip through the process.

Regards,
Lee Snover