Use of try/catch in updating function
Friday, 7 December 2012 · 1 message
AV
Arto Viitanen7 Dec 2012 13:54 #
7.12.2012 13:40, Christian Grün kirjoitti:
Quoted text · 17 lines
> Hi Arto, > > it’s generally allowed to use try/catch along with updating functions… > As long as both the try and the catch branch contain updating > statements. See the following self-contained, albeit useless, example: > > try { > delete node <a/> > } catch * { > delete node <b/> > } > > How did your query look like? > Christian > > >
Thank for your information. My query (I cannot show it, because if is for a customer and it is ~600 lines long) has two parts: check if the parameter
(or actually POST -message) is right, i.e. syntax is right and do the update. Since I was not even certain where the problem was, I thought to add try/catch around the whole code to see where it stops.
I found that file-module is your friend: add
file:append calls around the code and see how the query evaluates.--
Arto Viitanen
Microteam Oy
Finland
Written for BaseX 7.3. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery