Skip to content

Commit 6eb75a3

Browse files
blueyedbfredl
authored andcommitted
Fix/remove limit with format_exc_skip
This used limit=5 in several places, but this limits it to the first 5 frames, hiding the source of the exception! While limit=-5 could be used instead, I think it is better to provide the full traceback always.
1 parent cef445f commit 6eb75a3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

neovim/api/nvim.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def filter_request_cb(name, args):
159159
result = request_cb(name, args)
160160
except Exception:
161161
msg = ("error caught in request handler '{} {}'\n{}\n\n"
162-
.format(name, args, format_exc_skip(1, 5)))
162+
.format(name, args, format_exc_skip(1)))
163163
self._err_cb(msg)
164164
raise
165165
return walk(self._to_nvim, result)
@@ -171,7 +171,7 @@ def filter_notification_cb(name, args):
171171
notification_cb(name, args)
172172
except Exception:
173173
msg = ("error caught in notification handler '{} {}'\n{}\n\n"
174-
.format(name, args, format_exc_skip(1, 5)))
174+
.format(name, args, format_exc_skip(1)))
175175
self._err_cb(msg)
176176
raise
177177

@@ -342,7 +342,7 @@ def handler():
342342
except Exception as err:
343343
msg = ("error caught while executing async callback:\n"
344344
"{!r}\n{}\n \nthe call was requested at\n{}"
345-
.format(err, format_exc_skip(1, 5), call_point))
345+
.format(err, format_exc_skip(1), call_point))
346346
self._err_cb(msg)
347347
raise
348348
self._session.threadsafe_call(handler)

neovim/plugin/host.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ def _wrap_function(self, fn, sync, decode, nvim_bind, name, *args):
7171
except Exception:
7272
if sync:
7373
msg = ("error caught in request handler '{} {}':\n{}"
74-
.format(name, args, format_exc_skip(1, 5)))
74+
.format(name, args, format_exc_skip(1)))
7575
raise ErrorResponse(msg)
7676
else:
7777
msg = ("error caught in async handler '{} {}'\n{}\n"
78-
.format(name, args, format_exc_skip(1, 5)))
78+
.format(name, args, format_exc_skip(1)))
7979
self._on_async_err(msg + "\n")
8080

8181
def _on_request(self, name, args):

0 commit comments

Comments
 (0)