sinatra/sinatra — comment on commit fd74972da117524fe129ad912aab7fb811ced406
File: lib/sinatra/base.rb line 790
By carlhoerberg:

```PGconn#exec 'invalid sql'``` will throw an exception which will respond to ```code ```, but it's a postgres error code, eg. ```code: 83906754```, ```error: Key (id)=(1) already exists ```, not a http code.

a quick work around could be to check that the code is less than 600, but other custom exceptions maybe also respond to code, which might not be http error codes..