Problem: Error for Python exception does not show useful info.
Solution: Show the last line instead of the first one. (Ben Jackson,
closes #4381)
Py_BEGIN_ALLOW_THREADS
Python_Lock_Vim();
+ if (error)
+ emsg_severe = TRUE;
writer((writefn)(error ? emsg : msg), (char_u *)str, len);
Python_Release_Vim();
Py_END_ALLOW_THREADS
0.0
"\0": Vim(let):E859:
{"\0": 1}: Vim(let):E859:
-undefined_name: Vim(let):Trace
+undefined_name: Vim(let):NameE
vim: Vim(let):E859:
[1]
[1, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 1]
0.0
"\0": Vim(let):E859:
{"\0": 1}: Vim(let):E859:
-undefined_name: Vim(let):Trace
+undefined_name: Vim(let):NameE
vim: Vim(let):E859:
[1]
[1, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 1]
bwipe!
endfunction
+
+func Test_Catch_Exception_Message()
+ try
+ py raise RuntimeError( 'TEST' )
+ catch /.*/
+ call assert_match( '^Vim(.*):RuntimeError: TEST$', v:exception )
+ endtry
+endfunc
bwipe!
endfunction
+
+func Test_Catch_Exception_Message()
+ try
+ py3 raise RuntimeError( 'TEST' )
+ catch /.*/
+ call assert_match( '^Vim(.*):RuntimeError: TEST$', v:exception )
+ endtry
+endfunc
call assert_match(s:py3pattern, split(var)[0])
endif
endfunc
+
+func Test_Catch_Exception_Message()
+ try
+ pyx raise RuntimeError( 'TEST' )
+ catch /.*/
+ call assert_match( '^Vim(.*):RuntimeError: TEST$', v:exception )
+ endtry
+endfunc
call assert_match(s:py2pattern, split(var)[0])
endif
endfunc
+
+func Test_Catch_Exception_Message()
+ try
+ pyx raise RuntimeError( 'TEST' )
+ catch /.*/
+ call assert_match( '^Vim(.*):RuntimeError: TEST$', v:exception )
+ endtry
+endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1346,
/**/
1345,
/**/