Namespace fix for catching database errors.

Fixes habari/habari#485.