Skip to content

Show information when no alternative found #4

@PeterPablo

Description

@PeterPablo

Currently only a debug information followed by an error is printed to the console:

Thesaurus.thesaurus.NoResultError: 'Word not found.'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 549, in run_
    return self.run(edit)
  File "/Users/peterpablo/Library/Application Support/Sublime Text 3/Packages/Thesaurus/thesaurus.py", line 35, in run
    self.processWord(self.selected_word())
  File "/Users/peterpablo/Library/Application Support/Sublime Text 3/Packages/Thesaurus/thesaurus.py", line 55, in processWord
    self.alternatives.extend(self.get_alternative_words())
  File "/Users/peterpablo/Library/Application Support/Sublime Text 3/Packages/Thesaurus/thesaurus.py", line 135, in get_alternative_words
    if alternatives[0] == "error":
IndexError: list index out of range

I propose to show a prominent message, the same that is done when no word is selected Please select a word first!.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions