El 29/01/10 16:26, Thomas Mueller escribió:
> If you throw a SQLException in the function, then it will not be
> converted. Example:
>
> drop alias test;
> create alias test as 'int test() throws SQLException { throw new
> SQLException("Error Parsing..."); }';
> call test();
>
> This will throw the exception "Error Parsing...". If you throw any
> other type of exception in the function, it will be converted to the
> generic "Exception calling user-defined function".
>
> I will document that.
>   

One case I've seen time ago  (don't remember h2 version) ends with a
SQLException with different text.
In an SELECT query with UDF and other in an INSERT over a table with a
trigger that throw a exception with explanatory description.
Finally my exception get lost or converted and application receive
another exception with it's own description related to involved table.

May be in some case when rollback with multiple exception they are not
properly chained ?

I will try to reproduce that with actual version.

But  no matter that,  this seems a partial solution compared with RAISE
, because with an exception we can't set and SQLSTATE that can be used
programmatically at application level.
 
>> This approach does not help resolve the real need.
>>     
> I think it does. In my view RAISE is the same as "throw new SQLException".
>   

Thomas I don't reply to your answer.
When I say that not resolve the real need , I anwser to to Ivr123
suggestion to deal / convert the exception at GUI level.

El 28/01/10 07:29, lvr123 escribió:
> You have to catch the error at GUI level and make it more user-friendly, by 
> using the sql error codes.
>   


Regard,
Dario

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to