better formatted error message

This commit is contained in:
Alan Hamlett 2017-04-13 22:46:25 -07:00
parent 5de0208d3e
commit a2b7bf1161
1 changed files with 5 additions and 9 deletions

View File

@ -184,25 +184,21 @@ let s:VERSION = '4.0.14'
let cmd = cmd + ['--language', &filetype] let cmd = cmd + ['--language', &filetype]
endif endif
endif endif
if s:is_debug_mode_on let stdout = ''
echo 'Sending Heartbeat with Command: ' . s:JoinArgs(cmd)
endif
if s:IsWindows() if s:IsWindows()
if s:is_debug_mode_on if s:is_debug_mode_on
let stdout = system('(' . s:JoinArgs(cmd) . ')') let stdout = system('(' . s:JoinArgs(cmd) . ')')
if stdout != ''
echo stdout
endif
else else
exec 'silent !start /min cmd /c "' . s:JoinArgs(cmd) . '"' exec 'silent !start /min cmd /c "' . s:JoinArgs(cmd) . '"'
endif endif
else else
let stdout = system(s:JoinArgs(cmd) . ' &') let stdout = system(s:JoinArgs(cmd) . ' &')
if s:is_debug_mode_on && stdout != ''
echo stdout
endif
endif endif
call s:SetLastHeartbeat(a:time, a:time, file) call s:SetLastHeartbeat(a:time, a:time, file)
if s:is_debug_mode_on && stdout != ''
echo '[WakaTime] Heartbeat Command: ' . s:JoinArgs(cmd)
echo '[WakaTime] Error: ' . stdout
endif
endif endif
endfunction endfunction