Skip to content

Can the thrown exception be caught by VSCode? #121

Description

(Please use translation software for the following content.)
抛出的异常永远是直接退出,不能被VSCode捕获并暂停,然后WinUI的HRESULT有很多不是FormatMessage的标准HRESULT,导致一旦发生错误FormatMessage全是<no description>,然后建议在抛出的异常的信息里面加上WinRT内部报错信息,不然看的我不知所措

Unhandled exception caught: <bound method App.OnLaunched of <App object at 0x0000026F574CA0C0>>(<LaunchActivatedEventArgs object at 0x0000026F574CA040>,)
Traceback (most recent call last):
  File "c:\Program Files\Python310\lib\site-packages\win32more\_winrt.py", line 1011, in _winrt_callback_error_check
    self._winrt_callback(callback, restype, hints, this, *args)
  File "c:\Program Files\Python310\lib\site-packages\win32more\_winrt.py", line 1052, in _winrt_callback
    r = callback(*pyargs)
  File "C:\Users\this_\Desktop\Dev\Simple Minecraft Launcher\UI.py", line 10, in OnLaunched
    self.MainWindow=XamlLoader.Load(self,open('MainWindow.xaml','r',encoding="UTF-16-LE").read())
  File "c:\Program Files\Python310\lib\site-packages\win32more\xaml.py", line 185, in Load
    return cls().execute(view, xaml_str)
  File "c:\Program Files\Python310\lib\site-packages\win32more\xaml.py", line 192, in execute
    uiroot = as_runtime_class(XamlReader.Load(xaml_preprocessed))
  File "c:\Program Files\Python310\lib\site-packages\win32more\_winrt.py", line 745, in __call__
    return getattr(factory, self._prototype.__name__)(*args, **kwargs)
  File "c:\Program Files\Python310\lib\site-packages\win32more\_winrt.py", line 548, in __call__
    return self._generic_delegate[generic_args](this, *args, **kwargs)
  File "c:\Program Files\Python310\lib\site-packages\win32more\_winrt.py", line 622, in __call__
    raise WinError(hr)
OSError: [WinError -2144665590] <no description>

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