Fix issue #880 - more useful message to user when %paste fails #999

Merged
merged 2 commits into from Nov 21, 2011

Conversation

Projects
None yet
2 participants
@mattrco
Contributor

mattrco commented Nov 14, 2011

When tkinter is not installed and '%paste' is run, the user is now prompted to install it.

Initializes TryNext exception in CommandChainDispatcher with args/kwargs to present a message to the user with the traceback.

Fix issue #880 - initialize TryNext with args and kwargs.
Presents a message to the user along with the traceback prompting them to install tkinter.
@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Nov 14, 2011

Member

Thanks, Matt. I think it would be good to also catch this exception in magic_paste (see here), and just print an error message instead of showing an unhelpful traceback.

Member

takluyver commented Nov 14, 2011

Thanks, Matt. I think it would be good to also catch this exception in magic_paste (see here), and just print an error message instead of showing an unhelpful traceback.

@mattrco

This comment has been minimized.

Show comment
Hide comment
@mattrco

mattrco Nov 14, 2011

Contributor

Sounds good - and I'll also clean up the message. Still getting to grips with the codebase somewhat.

Contributor

mattrco commented Nov 14, 2011

Sounds good - and I'll also clean up the message. Still getting to grips with the codebase somewhat.

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Nov 14, 2011

Member

No worries - part of the idea behind quickfix bugs is to get new people into the code.

Member

takluyver commented Nov 14, 2011

No worries - part of the idea behind quickfix bugs is to get new people into the code.

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Nov 20, 2011

Member

@mattcottingham: Have you had a chance to have another look at this? Don't worry if not.

Member

takluyver commented Nov 20, 2011

@mattcottingham: Have you had a chance to have another look at this? Don't worry if not.

@mattrco

This comment has been minimized.

Show comment
Hide comment
@mattrco

mattrco Nov 20, 2011

Contributor

@takluyver, afraid I haven't had a chance this week - but I will have more time this coming week. Though if somebody else would like to fix it don't let this block them :)

Contributor

mattrco commented Nov 20, 2011

@takluyver, afraid I haven't had a chance this week - but I will have more time this coming week. Though if somebody else would like to fix it don't let this block them :)

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Nov 20, 2011

Member

That's alright, there's no rush. I just wanted to check in with you.

Member

takluyver commented Nov 20, 2011

That's alright, there's no rush. I just wanted to check in with you.

@mattrco

This comment has been minimized.

Show comment
Hide comment
@mattrco

mattrco Nov 21, 2011

Contributor

@takluyver, I've made a quick update to catch the exception in magic_paste. If an error message is provided, that is printed. Otherwise, if no other details are provided, a more generic message is printed.

In some ways I'd like to re-raise in magic_paste and handle the exception in the caller, but I realise that's not quite how TryNext is used across the project.

Any suggestions for improvement welcome!

Contributor

mattrco commented Nov 21, 2011

@takluyver, I've made a quick update to catch the exception in magic_paste. If an error message is provided, that is printed. Otherwise, if no other details are provided, a more generic message is printed.

In some ways I'd like to re-raise in magic_paste and handle the exception in the caller, but I realise that's not quite how TryNext is used across the project.

Any suggestions for improvement welcome!

@takluyver takluyver merged commit 205731a into ipython:master Nov 21, 2011

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Nov 21, 2011

Member

That's great. Don't worry, we don't generally raise exceptions from magic_* functions.

I've made one tiny change, so the error is a little bit tidier (213b5ed), and merged it.

Member

takluyver commented Nov 21, 2011

That's great. Don't worry, we don't generally raise exceptions from magic_* functions.

I've made one tiny change, so the error is a little bit tidier (213b5ed), and merged it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment