samedi 6 juin 2015

Racket db disconnect raises an exception

I'm using an sqlite database with racket's db module. After handling a failed insert or update due to duplicate key violations, if I try to disconnect using

(disconnect dbconn)

it successfully disconnects, but I get the following error

disconnect: abort due to contraint violation

I'm currently wrapping the disconnect function with

(define (my-disconnect dbconn)
     (with-handlers ([exn:fail? (lambda (e) (void))])
         (disconnect dbconn)))

but is there a way to stop disconnect from raising the error?

Aucun commentaire:

Enregistrer un commentaire