[Ur] Exceptions handling
Adam Chlipala
adamc at impredicative.com
Tue Aug 24 14:47:13 EDT 2010
Vladimir Shabanov wrote:
> And there is another way to check DML errors -- another function dml'
> can be adder which returns option string instead of error page, e.g.
> result<- dml' (...);
> case result of
> None => return "ok"
> Some e => return strcat("dberror: ", e)
>
I like this suggestion. The key issue is deciding which database errors
should be returned in this way. An error like "lost connection to
server" should still abort execution, IMO, since it's outside of the
abstraction that Ur/Web is meant to present to the programmer. A
corollary issue is which methods should be used with each database
system's C library to filter out the appropriate errors.
More information about the Ur
mailing list