Don't print the template filename and line number in error messages.
The template filename and line number do not correspond to the filename and line number of the actual template files, because they are representing the dynamically rendered template, not the text files on the disk, so printing it out, when an error occurs, may be misleading.
This commit is contained in:
parent
a4c638f132
commit
88969ae0db
@ -79,8 +79,8 @@ class BaseImageClass(BaseLoraxClass):
|
||||
func = getattr(self, func, None)
|
||||
|
||||
if not func:
|
||||
err = "{0}:{1}: invalid command: {2}"
|
||||
err = err.format(template_file, lineno, line)
|
||||
err = "invalid command: {0}"
|
||||
err = err.format(line)
|
||||
self.perror(err)
|
||||
else:
|
||||
try:
|
||||
@ -88,8 +88,8 @@ class BaseImageClass(BaseLoraxClass):
|
||||
self.pdebug(msg)
|
||||
func(*args)
|
||||
except TypeError:
|
||||
err = "{0}:{1}: invalid command syntax: {2}"
|
||||
err = err.format(template_file, lineno, line)
|
||||
err = "invalid command syntax: {0}"
|
||||
err = err.format(line)
|
||||
self.perror(err)
|
||||
|
||||
def makedirs(self, *dirs):
|
||||
|
Loading…
Reference in New Issue
Block a user