Trim SQL query length in catalogue DB failure reason
As shown in https://gitlab.cern.ch/cta/operations/-/issues/948#note_6285366, in the event of failure by taped, the SQL query is sometimes too long to be written in the reason field.
As a result, we get the logged ERROR:
MSG="The reason or comment has more characters than the maximun allowed."
In situations like this the SQL query should be trimmed to fit the reason field.
Edited by Joao Afonso