Skip to content

Commit 2dfdfd2

Browse files
committed
better error messages
1 parent d5a649b commit 2dfdfd2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def loadSnippetFromFile(snippetPath):
5252
def actionFromSnippet(snippetName, snippetDescription):
5353
if not snippetDescription:
5454
shortName = os.path.basename(snippetName)
55-
if shortName.endsWith('.py'):
55+
if shortName.endswith('.py'):
5656
shortName = shortName[:-3]
5757
return "Snippets\\" + shortName
5858
else:
@@ -64,11 +64,11 @@ def executeSnippet(code, context):
6464
if context.binaryView == None:
6565
dock = DockHandler.getActiveDockHandler()
6666
if not dock:
67-
log_error("Snippet triggered with no context and no dock handler.")
67+
log_error("Snippet triggered with no context and no dock handler. This should not happen. Please report reproduction steps if possible.")
6868
return
6969
viewFrame = dock.getViewFrame()
7070
if not viewFrame:
71-
log_error("Snippet triggered with no context and no view frame. This should not happen.")
71+
log_error("Snippet triggered with no context and no view frame. Snippets require at least one open binary.")
7272
return
7373
viewInterface = viewFrame.getCurrentViewInterface()
7474
context.binaryView = viewInterface.getData()

0 commit comments

Comments
 (0)