Try catch in db