WPF-Application crashes Dynamo

Although I use try and except or other safety functions, in a WPF-App crashes Dynamo and it shows me that error:
grafik

How can get errors in Python-Node, if I run a WPF-App in Python-Node?

Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt.

   bei System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   bei System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   bei CallSite.Target(Closure , CallSite , CodeContext , Object , Object , Object )
   bei lambda_method(Closure , Object[] , StrongBox`1[] , InterpretedFrame )
   bei Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   bei Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
   bei IronPython.Runtime.PythonProperty.__get__(CodeContext context, Object instance, Object owner)
   bei IronPython.Runtime.PythonProperty.TryGetValue(CodeContext context, Object instance, PythonType owner, Object& value)
   bei IronPython.Runtime.Types.GetMemberDelegates.SlotOnly(CallSite site, Object self, CodeContext context)
   bei Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
   bei Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   bei Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   bei CallSite.Target(Closure , CallSite , Object , Object , SelectionChangedEventArgs )
   bei _Scripting_(Object[] , Object , SelectionChangedEventArgs )
   bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   bei System.Windows.Controls.ComboBox.OnSelectionChanged(SelectionChangedEventArgs e)
   bei System.Windows.Controls.Primitives.Selector.SelectionChanger.End()
   bei System.Windows.Controls.Primitives.Selector.SelectionChanger.SelectJustThisItem(ItemInfo info, Boolean assumeInItemsCollection)
   bei System.Windows.Controls.ComboBox.SelectPrev()
   bei System.Windows.Controls.ComboBox.KeyDownHandler(KeyEventArgs e)
   bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   bei System.Windows.Input.InputManager.ProcessStagingArea()
   bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   bei System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)
   bei System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
   bei System.Windows.Interop.HwndKeyboardInputProvider.FilterMessage(IntPtr hwnd, WindowMessage message, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

I am trying to select categories in a combo box and then list families that has same categories with selected item of combo box. It works perfectly but not on some categories.

I had to catch the exception in function.

1 Like