db exception handling