refined NotFoundError doc

This commit is contained in:
David Halter
2012-08-31 17:01:14 +02:00
parent 5e22c6e6c0
commit 3a8754b9f1
3 changed files with 5 additions and 2 deletions

View File

@@ -133,6 +133,10 @@ have the following objects available:
> imports and doesn't break there. You probably don't want to use this > imports and doesn't break there. You probably don't want to use this
> function. It's mostly for testing. > function. It's mostly for testing.
`NotFoundError`
> If you use the goto function and no valid identifier (name) is at the
> place of the cursor (position). It will raise this exception.
`set_debug_function` `set_debug_function`
> Sets a callback function for `debug.py`. This function is called with > Sets a callback function for `debug.py`. This function is called with
> multiple text objects, in python 3 you could insert `print`. > multiple text objects, in python 3 you could insert `print`.

View File

@@ -9,7 +9,6 @@ import debug
import imports import imports
import os import os
# TODO remove NotFoundError, should not be exposed
__all__ = ['complete', 'goto', 'get_definitions', __all__ = ['complete', 'goto', 'get_definitions',
'NotFoundError', 'set_debug_function'] 'NotFoundError', 'set_debug_function']

View File

@@ -88,7 +88,7 @@ if 1:
try: try:
definitions = functions.goto(source, row, column, buf_path) definitions = functions.goto(source, row, column, buf_path)
except functions.NotFoundError: except functions.NotFoundError:
echo_highlight("Couldn't find a place to goto.") echo_highlight("Cannot follow nothing. Put your cursor on a valid name.")
except Exception: except Exception:
# print to stdout, will be in :messages # print to stdout, will be in :messages
echo_highlight("Some different eror, this shouldn't happen.") echo_highlight("Some different eror, this shouldn't happen.")