Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

xolox#misc#os#exec(): Improve error reporting about temporary files

  • Loading branch information...
commit 3d246a66c42ee77edcc6d849252cdefafb309b4f 1 parent 78a6ee0
@xolox authored
View
2  README.md
@@ -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
View
4 autoload/xolox/misc.vim
@@ -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'
View
10 autoload/xolox/misc/os.vim
@@ -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
@@ -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.
@@ -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
View
4 doc/misc.txt
@@ -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*
Please sign in to comment.
Something went wrong with that request. Please try again.