Skip to content

Commit

Permalink
Improve error message when LockError is raised
Browse files Browse the repository at this point in the history
  • Loading branch information
algomaster99 committed Nov 13, 2019
1 parent c1bbd8d commit 7f12ef8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions dvc/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import time
from datetime import timedelta

import colorama
from funcy.py3 import lkeep

from dvc.exceptions import DvcException
Expand Down Expand Up @@ -73,7 +74,11 @@ def lock(self):
except flufl.lock.TimeOutError:
raise LockError(
"cannot perform the cmd since DVC is busy and "
"locked. Please retry the cmd later."
"locked. You can delete .dvc/lock to fix it, but first "
"please make sure there's no other dvc process ongoing "
"by running: {blue}`ps xaf | grep dvc`{nc}.".format(
blue=colorama.Back.BLUE, nc=colorama.Back.RESET
)
)

def _set_claimfile(self, pid=None):
Expand Down Expand Up @@ -121,7 +126,11 @@ def _do_lock(self):
except zc.lockfile.LockError:
raise LockError(
"cannot perform the cmd since DVC is busy and "
"locked. Please retry the cmd later."
"locked. You can delete .dvc/lock to fix it, but first "
"please make sure there's no other dvc process ongoing "
"by running: {blue}`ps xaf | grep dvc`{nc}.".format(
blue=colorama.Back.BLUE, nc=colorama.Back.RESET
)
)

def lock(self):
Expand Down

0 comments on commit 7f12ef8

Please sign in to comment.