Hallo,
when raising custom exception in a stored procedure, the try-except block catches EIBCError. The property Message inherited from class Exception containes not only my customized message, but also the exception name and ID, and also the sentence 'At procedure MyProcName'
Please, how can I customize the whole message in the Message property ?
Thanks in advance for any hints
Boro
Text in EIBCError.Message
In this case it is already a catched and customized exception.To customize the error message, you can catch the exception
I created the exception with its text in the db. It has the exception ID 12, and a name I have assigned. Inside the procedure when a select into doesn't return the right data I am raising this exception using SQL statement EXCEPTION ... And in this statement I am again assigning a more customized message (filled with some info).
What I am surprised with, is that in the IDBCError.Message property isn't only my customized one, but it is surrounded by additional infos. For example
- exception object's id I createdexception 12
- exception's name I createdEX_STOCKNUMBAD
- my own more customized msg, from the point of rising it.Item V555 doesn't exist
- proc.nameAt procedure 'SP_SAVE_HEADIN'
It is fine you make these info avalable. But it would be much better if you put them into separate properties instead of clatching them all into one text delimited by #13 character. And the exception ID or proc.name you have to extract even from the line of text at some special position ...
I do not want to criticise you. I am satisified with IBDAC untill now as I am in the beginning of learning it.
Boro
IBDAC gets an error message from the InterBase client, and puts this text to the Message property of TIBCError 'as is'. So format of error messages depends on InterBase client and server.
We'll consider possibility to parse error messages in IBDAC, but that is hardly to happen in the nearest future.
We'll consider possibility to parse error messages in IBDAC, but that is hardly to happen in the nearest future.