Improve error handling of beautify and testing

This commit is contained in:
Glavin Wiechert 2017-06-16 01:22:19 -03:00
parent a5a00c893e
commit 0b2b06a928
2 changed files with 2 additions and 2 deletions

View File

@ -184,7 +184,7 @@ describe "BeautifyLanguages", ->
beautifyCompleted = false beautifyCompleted = false
completionFun = (text) -> completionFun = (text) ->
try try
expect(text instanceof Error).not.toEqual(true, text.toString()) expect(text instanceof Error).not.toEqual(true, text.message or text.toString())
return beautifyCompleted = true if text instanceof Error return beautifyCompleted = true if text instanceof Error
# logger.verbose(expectedTestPath, text) if ext is ".less" # logger.verbose(expectedTestPath, text) if ext is ".less"
# if text instanceof Error # if text instanceof Error

View File

@ -179,7 +179,7 @@ class Executable
if @isWindows() and returnCode is 1 and stderr.indexOf(windowsProgramNotFoundMsg) isnt -1 if @isWindows() and returnCode is 1 and stderr.indexOf(windowsProgramNotFoundMsg) isnt -1
throw @commandNotFoundError(exeName, help) throw @commandNotFoundError(exeName, help)
else else
throw new Error(stderr) throw new Error(stderr or stdout)
else else
if returnStderr if returnStderr
stderr stderr