ThreadException

0
0

Hi,

we use function Application.ThreadException += Application_ThreadException to handle thread exception and log the error.  We have a background thread, that processes the changes from database and do update datasource for component DataRepeater. Sometime we got the exception in log but do not know where they come from and how to handle them. They are inside Wisej.

on_ThreadException – ThreadException,
System.ArgumentException: Invisible or disabled control cannot be activated
at Wisej.Web.ContainerControl.SetActiveControl(Control value)
at Wisej.Web.ContainerControl.set_ActiveControl(Control value)
at Wisej.Web.Control.<>c__DisplayClass777_0.<Focus>b__0()
at Wisej.Web.Application.RunInContext(IWisejComponent context, Action action)
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Wisej.Web.Application.RunInContext(IWisejComponent context, Action action)
at Wisej.Web.Control.Focus()
at Wisej.Web.MessageBox.ProcessCloseWebEvent(WisejEventArgs e)
at Wisej.Web.MessageBox.OnWebEvent(WisejEventArgs e)
at Wisej.Base.Component.Wisej.Core.IWisejComponent.Event(WisejEventArgs e)
at Wisej.Web.Application.ProcessWebEvent(WisejEventArgs e)
at Wisej.Web.Application.OnWebEvent(WisejEventArgs e)
at Wisej.Web.Application.Wisej.Core.IWisejComponent.Event(WisejEventArgs e)
at Wisej.Core.ComponentManager.DispatchEvents(Session session, ICollection events)
at CallSite.Target(Closure , CallSite , ComponentManager , Session , Object )
at Wisej.Core.ResponseManager.<>c__DisplayClass25_0.<OnEvent>b__0()
at Wisej.Core.IWisejSynchronizedImplementation.Lock(IWisejSynchronized target, Action action)
at Wisej.Core.ResponseManager.OnEvent(Session session, Object message)
at CallSite.Target(Closure , CallSite , ResponseManager , Session , Object )
at Wisej.Core.ResponseManager.ProcessRequest(ServiceType service, Object message)

or

on_ThreadException – ThreadException,
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: value
at Wisej.Web.DataRepeater.set_CurrentItemIndex(Int32 value)
at Wisej.Web.DataRepeater.ProcessSelectionChangedWebEvent(WisejEventArgs e)
at Wisej.Web.DataRepeater.OnWebEvent(WisejEventArgs e)
at Wisej.Web.Control.Wisej.Core.IWisejComponent.Event(WisejEventArgs e)
at Wisej.Web.Application.ProcessWebEvent(WisejEventArgs e)
at Wisej.Web.Application.OnWebEvent(WisejEventArgs e)
at Wisej.Web.Application.Wisej.Core.IWisejComponent.Event(WisejEventArgs e)
at Wisej.Core.ComponentManager.DispatchEvents(Session session, ICollection events)
at CallSite.Target(Closure , CallSite , ComponentManager , Session , Object )
at Wisej.Core.ResponseManager.<>c__DisplayClass25_0.<OnEvent>b__0()
at Wisej.Core.IWisejSynchronizedImplementation.Lock(IWisejSynchronized target, Action action)
at Wisej.Core.ResponseManager.OnEvent(Session session, Object message)
at CallSite.Target(Closure , CallSite , ResponseManager , Session , Object )
at Wisej.Core.ResponseManager.ProcessRequest(ServiceType service, Object message)

Could you please give us advice how to handle it?

Thank you for your help,

Page

 

  • You must to post comments
0
0

The first exception means that the control that was active before the message box was shown is not hidden and a hidden control cannot be activated.

The second it’s probably  your thread that is removing a data item without update the index. These are the risks of running background thread that update controls without any synchronization.

The best way to find out which part of the code are causing the issue is to enable the exceptions in Visual Studio, it will break where the exception is thrown and you can try to inspect your objects.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.