Skip to content

Commit

Permalink
Fix/remove limit with format_exc_skip
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
blueyed authored and bfredl committed Nov 8, 2016
1 parent cef445f commit 6eb75a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions neovim/api/nvim.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def filter_request_cb(name, args):
result = request_cb(name, args)
except Exception:
msg = ("error caught in request handler '{} {}'\n{}\n\n"
.format(name, args, format_exc_skip(1, 5)))
.format(name, args, format_exc_skip(1)))
self._err_cb(msg)
raise
return walk(self._to_nvim, result)
Expand All @@ -171,7 +171,7 @@ def filter_notification_cb(name, args):
notification_cb(name, args)
except Exception:
msg = ("error caught in notification handler '{} {}'\n{}\n\n"
.format(name, args, format_exc_skip(1, 5)))
.format(name, args, format_exc_skip(1)))
self._err_cb(msg)
raise

Expand Down Expand Up @@ -342,7 +342,7 @@ def handler():
except Exception as err:
msg = ("error caught while executing async callback:\n"
"{!r}\n{}\n \nthe call was requested at\n{}"
.format(err, format_exc_skip(1, 5), call_point))
.format(err, format_exc_skip(1), call_point))
self._err_cb(msg)
raise
self._session.threadsafe_call(handler)
Expand Down
4 changes: 2 additions & 2 deletions neovim/plugin/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ def _wrap_function(self, fn, sync, decode, nvim_bind, name, *args):
except Exception:
if sync:
msg = ("error caught in request handler '{} {}':\n{}"
.format(name, args, format_exc_skip(1, 5)))
.format(name, args, format_exc_skip(1)))
raise ErrorResponse(msg)
else:
msg = ("error caught in async handler '{} {}'\n{}\n"
.format(name, args, format_exc_skip(1, 5)))
.format(name, args, format_exc_skip(1)))
self._on_async_err(msg + "\n")

def _on_request(self, name, args):
Expand Down

0 comments on commit 6eb75a3

Please sign in to comment.