Skip to content

Commit 079a948

Browse files
committed
Merge pull request #62 from Floobits/master
Log error message when no handlers are found.
2 parents b5b5fec + 6d0f9f5 commit 079a948

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

neovim/msgpack_rpc/session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import greenlet
88

99
logger = logging.getLogger(__name__)
10-
debug, info, warn = (logger.debug, logger.info, logger.warn,)
10+
error, debug, info, warn = (logger.error, logger.debug, logger.info,
11+
logger.warn,)
1112

1213

1314
class Session(object):
@@ -100,6 +101,7 @@ def on_setup():
100101
gr.switch()
101102

102103
if self._setup_exception:
104+
error('Setup error: {0}'.format(self._setup_exception))
103105
raise self._setup_exception
104106

105107
# Process all pending requests and notifications

neovim/plugin/host.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ def _load(self, plugins):
8181
try:
8282
module = imp.load_module(name, file, pathname, description)
8383
except ImportError:
84-
error('Encountered import error loading plugin at %s' % path)
84+
error('Encountered import error loading plugin at {0}'.format(
85+
path))
8586
except Exception as e:
86-
error('Error loading plugin at %s %s: %s' % (
87+
error('Error loading plugin at {0} {1}: {2}'.format(
8788
path, type(e).__name__, e))
8889
handlers = []
8990
self._discover_classes(module, handlers, path)
@@ -132,13 +133,13 @@ def _discover_functions(self, obj, handlers, plugin_path):
132133
method = '{0}:{1}'.format(plugin_path, method)
133134
if fn._nvim_rpc_sync:
134135
if method in self._request_handlers:
135-
raise Exception('Request handler for "{0}" is ' +
136-
'already registered'.format(method))
136+
raise Exception(('Request handler for "{0}" is ' +
137+
'already registered').format(method))
137138
self._request_handlers[method] = fn
138139
else:
139140
if method in self._notification_handlers:
140-
raise Exception('Notification handler for "{0}" is ' +
141-
'already registered'.format(method))
141+
raise Exception(('Notification handler for "{0}" is ' +
142+
'already registered').format(method))
142143
self._notification_handlers[method] = fn
143144
if hasattr(fn, 'nvim_rpc_spec'):
144145
specs.append(fn.nvim_rpc_spec)

0 commit comments

Comments
 (0)