Better error message in case of database lock