How to stop/fail solution import using pre-import hook

Hi Servoy,

We are trying to use the pre-import hook modules to implement some of our custom solution deployment tasks (in particular, changing the database schema to match the new version of the application). Under certain conditions, we would like the import to stop/fail, however all errors thrown in the onOpen method of the pre-import hook module seem to be ignored by the Servoy solution import because it happily continues and at the end shows that the import was successful. Is this the designed behavior or is this a bug?

In our opinion, if any of the pre-import hook modules throws and error, that should be an indication to Servoy that the import must be stopped and that the new version of the solution(s) should not be imported. Consider cases where the pre-import hook must create/alter the necessary database tables used by the solutions which are about to be imported - if the database table creation/alteration fails, why would anyone want the solutions to be imported? Relying on the administrators to delete the erroneously imported solutions after the import finishes is not an option. Unfortunately we see similar behavior when no pre-import hooks are used, but simply the option to allow database changes is not selected during the import - in such cases the import log shows that the import has failed due to the database changes restriction but still the solutions show up on the solutions list as being imported and available and end-users can attempt to load them, even though they are not functional.

Please create a case for this.

lvostinar:
Please create a case for this.

The case is: Jira