Skip to content

Commit 3d246a6

Browse files
committed
xolox#misc#os#exec(): Improve error reporting about temporary files
See issue xolox/vim-easytags#58: xolox/vim-easytags#58
1 parent 78a6ee0 commit 3d246a6

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ from the source code of the miscellaneous scripts using the Python module
3838
<!-- Start of generated documentation -->
3939

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

4343
### Handling of special buffers
4444

autoload/xolox/misc.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" The version of my miscellaneous scripts.
22
"
33
" Author: Peter Odding <[email protected]>
4-
" Last Change: June 23, 2013
4+
" Last Change: June 25, 2013
55
" URL: http://peterodding.com/code/vim/misc/
66

7-
let g:xolox#misc#version = '1.8'
7+
let g:xolox#misc#version = '1.8.1'

autoload/xolox/misc/os.vim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" Operating system interfaces.
22
"
33
" Author: Peter Odding <[email protected]>
4-
" Last Change: June 19, 2013
4+
" Last Change: June 25, 2013
55
" URL: http://peterodding.com/code/vim/misc/
66

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

216216
endfunction
217217

218-
function! s:readfile(fname) " {{{1
219-
" readfile() that swallows errors.
218+
function! s:readfile(fname, label, cmd) " {{{1
220219
try
221220
return readfile(a:fname)
222221
catch
222+
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)
223223
return []
224224
endtry
225225
endfunction

doc/misc.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ For those who are curious: The function descriptions given below were extracted
149149
from the source code of the miscellaneous scripts using the Python module
150150
'vimdoctool.py' included in vim-tools [5].
151151

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

155155
-------------------------------------------------------------------------------
156156
*misc-handling-of-special-buffers*

0 commit comments

Comments
 (0)