evalVariable: Thows ShellVariableError if no variable is found
This commit is contained in:
parent
cdae96263b
commit
aa528eb717
|
@ -161,7 +161,11 @@ proc evalVariable(vari: string): string =
|
|||
result=shellVariables[vari]
|
||||
elif envVariables.hasKey(vari):
|
||||
result = envVariables[vari]
|
||||
else: raise newException(Exception, "No such variable: " & vari & ".")
|
||||
else:
|
||||
var e = newException(ShellVariableError, "No such variable: " & vari)
|
||||
e.variable = vari
|
||||
e.msg = "No such variable: " & e.variable
|
||||
raise e
|
||||
|
||||
# substitute does a substitution on the stream passed in
|
||||
proc substitute(strm: Stream, delim=";\p"): string =
|
||||
|
|
Loading…
Reference in New Issue