error handling for pleasant lawyer