metrics add: Raise exception when path does not exist

Fix #1316
This commit is contained in:
Mr. Outis
2018-11-19 20:52:28 -06:00
parent 119579af0f
commit 3910eb6065
+3
View File
@@ -1023,6 +1023,9 @@ class Project(object):
self._metrics_modify(path, typ, xpath)
def metrics_add(self, path, typ=None, xpath=None):
if not os.path.exists(path):
raise DvcException('File does not exist'.format(path))
if not typ:
typ = 'raw'
self._metrics_modify(path, typ, xpath)