You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when it is ran, it just does not catches it. Does not matter if I try it within TypeError, Exception or BaseException classes. This below is the full exception output.
The problem is, the python cannot catch the exception throwed by run_command( "side_bar_update_sync" ). The exception catching for errors like trying to call self.view, when there is no self passed by, are working fine. This is the full code:
The text was updated successfully, but these errors were encountered:
FichteFoll
changed the title
Sublime Text Python's Interpreter for packages is not catching an exception throwed by sublime.py
Exceptions from executing commands with wrong arguments cannot be caught
Sep 14, 2016
I tend to doubt this will really change. When you try to run a command, the request is sent to the sublime_text executable. If it is an internal command, it is executed in C++. If it is implemented in Python, sublime_text sends a message to plugin_host to execute the command. If there is an error in running the command, there is no way to throw the exception back through sublime_text and then back into plugin_host.
It will also be made even further more complicated by future changes to how the plugin_host works.
While catching the exact exception may not be important, what about giving run_command a boolean return value indicating whether the command was executed properly? Currently you receive absolutely zero feedback from your code whether a command did its work, failed somewhere or outright doesn't exist (I believe we had an issue for that but can't find it).
Sublime Text Python's Interpreter for packages is not catching an exception throwed by
sublime.py
This was migrated from http://stackoverflow.com/questions/39461428/how-to-catch-sublime-text-exceptions-on-their-python-interpreter.
I am trying to catch this exception:
But when it is ran, it just does not catches it. Does not matter if I try it within
TypeError
,Exception
orBaseException
classes. This below is the full exception output.The problem is, the python cannot catch the exception throwed by
run_command( "side_bar_update_sync" )
. The exception catching for errors like trying to callself.view
, when there is no self passed by, are working fine. This is the full code:This discussion may be followed by this Sublime Text Forum's thread: https://forum.sublimetext.com/t/how-to-add-remove-a-default-menu-entry-when-a-x-package-is-isnt-enabled-installed/22753?u=addons_zz
This are the lines from the file showed on the exception:
Environment
The text was updated successfully, but these errors were encountered: