More useful error classes
I think I will pass on this functionality.
 @macks22 but you know what key was passed to your function. Why not use it instead of taking this value from the exception? 
 @arikfr that's basically what I was getting at...there's no new info there.
 Yes, this is what I ended up doing. I guess I just have a habit of packing as much info as possible into my exception instances. In this case it's not necessary though. Thanks for the quick feedback.

It would be useful to be able to access pieces of the sql query that raised the error. Right now this requires parsing the `message` instance variable of the error. For instance, assume I have some `Model` instance stored in a variable `table` and I run `Model.get` using a key that does not exist. This will raise a `Model.DoesNotExist` exception:

```
try:
    table.get(key = 'test')
except table.DoesNotExist as err:
    print(dir(err))
```

The output shows that only two instance variables are present: the standard `args` and `message`. The `message` is (table fields are "key" and "val"):

```
'Instance matching query does not exist:\nSQL: SELECT "t1"."key", "t1"."val" FROM "keyvaluepair" AS t1 WHERE ("t1"."key" = ?)\nPARAMS: [u\'test2\']'
```

For this particular error, it would be nice to have another instance variable with the key. In general, it could be a `tuple` that contains all the parameters used to fill in the "?" placeholders in the query.

Why would this be useful? Well in this case, I'm implementing a simple DB-backed dictionary. I'd like to except the `table.DoesNotExist` exception and repackage it as a `KeyError` to be raised up to the user. However, I don't know what key caused the error without parsing the `message` attribute.
