Skip to content

Commit 5dbf6f6

Browse files
committed
Include failing paths/projects in exception messages.
1 parent 7104253 commit 5dbf6f6

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

gcloud/_helpers.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,12 +416,14 @@ def _name_from_project_path(path, project, template):
416416
match = template.match(path)
417417

418418
if not match:
419-
raise ValueError('path did not match: %s' % (template.pattern,))
419+
raise ValueError('path "%s" did not match expected pattern "%s"' % (
420+
path, template.pattern,))
420421

421422
found_project = match.group('project')
422423
if found_project != project:
423-
raise ValueError('Project from client should agree with '
424-
'project from resource.')
424+
raise ValueError(
425+
'Project from client (%s) should agree with '
426+
'project from resource(%s).' % (project, found_project))
425427

426428
return match.group('name')
427429

0 commit comments

Comments
 (0)