Skip to content

Commit

Permalink
xolox#misc#os#exec(): Improve error reporting about temporary files
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Jun 24, 2013
1 parent 78a6ee0 commit 3d246a6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ from the source code of the miscellaneous scripts using the Python module
<!-- Start of generated documentation -->

The documentation of the 79 functions below was extracted from
16 Vim scripts on June 23, 2013 at 23:14.
15 Vim scripts on June 25, 2013 at 00:11.

### Handling of special buffers

Expand Down
4 changes: 2 additions & 2 deletions autoload/xolox/misc.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" The version of my miscellaneous scripts.
"
" Author: Peter Odding <peter@peterodding.com>
" Last Change: June 23, 2013
" Last Change: June 25, 2013
" URL: http://peterodding.com/code/vim/misc/

let g:xolox#misc#version = '1.8'
let g:xolox#misc#version = '1.8.1'
10 changes: 5 additions & 5 deletions autoload/xolox/misc/os.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" Operating system interfaces.
"
" Author: Peter Odding <peter@peterodding.com>
" Last Change: June 19, 2013
" Last Change: June 25, 2013
" URL: http://peterodding.com/code/vim/misc/

function! xolox#misc#os#is_mac() " {{{1
Expand Down Expand Up @@ -182,8 +182,8 @@ function! xolox#misc#os#exec(options) " {{{1
let result = {'command': cmd}
if !async
let result['exit_code'] = exit_code
let result['stdout'] = s:readfile(tempout)
let result['stderr'] = s:readfile(temperr)
let result['stdout'] = s:readfile(tempout, 'standard output', a:options['command'])
let result['stderr'] = s:readfile(temperr, 'standard error', a:options['command'])
" If we just executed a synchronous command and the caller didn't
" specifically ask us *not* to check the exit code of the external
" command, we'll do so now.
Expand Down Expand Up @@ -215,11 +215,11 @@ function! xolox#misc#os#exec(options) " {{{1

endfunction

function! s:readfile(fname) " {{{1
" readfile() that swallows errors.
function! s:readfile(fname, label, cmd) " {{{1
try
return readfile(a:fname)
catch
call xolox#misc#msg#warn("vim-misc %s: Failed to read temporary file (%s) with %s of external command: %s! (external command: %s)", g:xolox#misc#version, a:fname, a:label, v:exception, a:cmd)
return []
endtry
endfunction
Expand Down
4 changes: 2 additions & 2 deletions doc/misc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ For those who are curious: The function descriptions given below were extracted
from the source code of the miscellaneous scripts using the Python module
'vimdoctool.py' included in vim-tools [5].

The documentation of the 79 functions below was extracted from 16 Vim scripts
on June 23, 2013 at 23:14.
The documentation of the 79 functions below was extracted from 15 Vim scripts
on June 25, 2013 at 00:11.

-------------------------------------------------------------------------------
*misc-handling-of-special-buffers*
Expand Down

0 comments on commit 3d246a6

Please sign in to comment.