[Ur] Exceptions handling
Adam Chlipala
adamc at impredicative.com
Tue Aug 24 11:34:07 EDT 2010
Vladimir Shabanov wrote:
> 2010/8/24 Adam Chlipala<adamc at impredicative.com>:
>
>> Vladimir Shabanov wrote:
>>
>>> Ur/Web can throw error on invalid DML (for example "ERROR: duplicate
>>> key value violates unique constraint ..."). Currently this error
>>> results in invalid page.
>>>
>>> Is there a way to handle such errors?
>>>
>>>
>> No, there is no support for that right now. Do you have a suggestion of
>> what support you would like to see?
>>
> There are several ways to add exceptions.
>
This is certainly a thorough list of ways of supporting general
exception-handling, but I had hoped (and continue to hope) Ur wouldn't
need any such facility. ;)
Why can't you just check for uniqueness constraint violations in your
code before inserting into the database? I can see the case for a
simple facility for specifying an alternate error-reporting page, but
more than that doesn't seem worthwhile. These errors should only come
up in buggy programs.
More information about the Ur
mailing list