database errors converted to exceptions