How could one handle exceptions globally with Flask? I have found ways to use the following to handle custom db interactions:

```
try:
    sess.add(cat2)
    sess.commit()
except sqlalchemy.exc.IntegrityError, exc:
    reason = exc.message
    if reason.endswith('is not unique'):
        print "%s already exists" % exc.params[0]
        sess.rollback()

```

The problem with `try`-`except` is I would have to run that on every aspect of my code. I can find better ways to do that for custom code. My question is directed more towards global catching and handling for:

```
apimanager.create_api(
    Model,
    collection_name="models",
    **base_writable_api_settings
)

```

I have found that this `apimanager` accepts `validation_exceptions`: [`ValidationError`] but I have found no examples of this being used.

I still would like a higher tier of handling that effects all db interactions with a simple concept of "If this error: show this, If another error: show something else" that just runs on all interactions/exceptions automatically without me including it on every `apimanager` (putting it in my `base_writable_api_settings` is fine I guess). (`IntegrityError`, `NameError`, `DataError`, `DatabaseError`, etc)