Catch adapter being None and print user-friendly message:
This commit is contained in:
parent
cd26e81fd9
commit
1b7402915c
2 changed files with 12 additions and 2 deletions
|
|
@ -136,7 +136,17 @@ class DebugSession( object ):
|
||||||
configuration = configurations[ configuration_name ]
|
configuration = configurations[ configuration_name ]
|
||||||
adapter = configuration.get( 'adapter' )
|
adapter = configuration.get( 'adapter' )
|
||||||
if isinstance( adapter, str ):
|
if isinstance( adapter, str ):
|
||||||
adapter = adapters.get( adapter )
|
adapter_dict = adapters.get( adapter )
|
||||||
|
|
||||||
|
if adapter_dict is None:
|
||||||
|
utils.UserMessage( f"The specified adapter '{adapter}' is not "
|
||||||
|
"available. Did you forget to run "
|
||||||
|
"'install_gadget.py'?",
|
||||||
|
persist = True,
|
||||||
|
error = True )
|
||||||
|
return
|
||||||
|
|
||||||
|
adapter = adapter_dict
|
||||||
|
|
||||||
# TODO: Do we want some form of persistence ? e.g. self._staticVariables,
|
# TODO: Do we want some form of persistence ? e.g. self._staticVariables,
|
||||||
# set from an api call like SetLaunchParam( 'var', 'value' ), perhaps also a
|
# set from an api call like SetLaunchParam( 'var', 'value' ), perhaps also a
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"attach": {
|
"attach": {
|
||||||
"adapter": "vscode-python",
|
"adapter": "debugpy",
|
||||||
"configuration": {
|
"configuration": {
|
||||||
"request": "attach",
|
"request": "attach",
|
||||||
"type": "python",
|
"type": "python",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue