UWP WebView causing exception - xaml

I have a WebView in a Page that is used in a NavigationView. When I swicth to the corresponding tab the following exception is thrown:
Exception thrown at 0x75234662 (KernelBase.dll) in MyApp.exe: WinRT originate error - 0x8001010E : 'DispatcherQueueController is already created on this thread.'.
I determined it was the WebView that causes it through a process of elimination. It still occurs if I replace the xaml for the WebView with a sample from the docs. I.e.:
<WebView x:Name="webView1" Source="http://www.contoso.com"/>
Why is this happening? Might it cause problems? I found it while investigating occasional fatal exceptions from ucrtbase.dll. Might that be related?

Related

How to catch exceptions thrown by UseDeveloperExceptionPage in asp.net core?

I'm using Dapper with a custom SqlMapper.TypeHandler for handling Uris. Whenever the Uri is not well-formed, the Parse method in the custom handler throws System.UriFormatException, which I expect to bubble up, caught by the UseDeveloperExceptionPage and displayed on the browser. But all I get is an empty page.
Looking at the VS stack trace, the following line seems to indicate the problem, but I don't know how to get around it:
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware: Error: An exception was thrown attempting to display the error page.
When I use my custom exception handler, app.UseExceptionHandler("error"), I'm able to display the error.
This is the only relevant discussion I could find, https://github.com/aspnet/AspNetCore/issues/3301, which was closed last year without a resolution.

Visual Studio giving generic debug errors, but gives specific errors out of debug

I don't even know what to call this, but here's the situation - I use Visual Studio 2013 to create a Windows Forms Project. At some point, the debugger started throwing out this error:
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an invocation.
However, I happened to notice that when I run the program without debugging, and the error occurs, it gives me:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
It's not a complicated program, I'm not doing anything like multithreading or delegating yet. No matter what I try, it only gives the first error. I've gotten it when I was try to delete a file that didn't exist, when the index was out of bounds, when a control threw an error. All these errors just quoted the first one in debug mode, but the normal errors out of debug mode.
I just threw the code in another project and it works fine. Maybe it's a option in the debugging menu, but I've tried everything I could imagine. I also tried updating to VS2013 Update 4 and it still does it. Help?
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an invocation.
A TargetInvocationException is a wrapper around the actual exception.
"The client application's event-handler delegate should check the Error property; otherwise, the property will raise a TargetInvocationException"
Try returning a try catch and get the ex.InnerException
and see why it is giving this error
System.IndexOutOfRangeException: Index was outside the bounds of the array.
try this as well
try {
//here you read the arguments and pass to a variable
}
catch(System.IndexOutOfRangeException) {
//other codepart
}
Hope this helps

How do I catch 'Uncaught typeError: Cannot read property 'isModel' of undefined' during App load?

I'm developing ST2 on Chrome which uses localstorage. From time to time, it appears that the storage schema gets corrupted. When this happens, my app fails during load with "Uncaught typeError: Cannot read property 'isModel' of undefined". The only way to get my app running is to do localstorage.clear() in the console.
I'm assuming this is an ST2 bug, since the occurrence of the corruption seems unrelated to my code, or what I do in my app.
My main question is how do I catch the exception in such a way that either the app can recover, or the user is alerted as to what is going on? Right now, the app simply fails to load. I've tried wrapping the Ext.application() in app.js, but that is executing correctly. My launch function is not being reached.
There must be some weird thing going on with your app. Probably you have found the reason meanwhile and recognised the failing bit is somewhere in your app. Anyway if you are experiencing anything like this then probably the best bet is to catch the error event and do your error handling there. I.e.
window.addEventListener("error", function(errorEvent) {
//
// Add your error handling here
//
// if returns true, the error is suppressed and not thrown
return false;
});

Trying to trace an error in xcode

When I start up my application I get the error detailed below. If I continue the application everything seems to be working fine. The error is raised between the calls to applicationWillFinishLaunching and applicationDidFinishLaunching.
I suspect the eror is getting generated when the xib is being loaded, however I can see nothing wrong with the xib and how it is connected up. Can anyone give me some tips on how I can trace back to find the source of the error?
Thanks,
2012-08-21 11:31:55.293 ConjugationViewer[32508:707] *** Assertion failure in -[NSTextFieldCell _objectValue:forString:errorDescription:], /SourceCache/AppKit/AppKit-1138.47/AppKit.subproj/NSCell.m:1564
2012-08-21 11:31:55.303 ConjugationViewer[32508:707] Ignoring exception raised in __-[NSPersistentUIManager restoreAllPersistentStateWithTalagentWindows:registeringAsReadyWhenDone:completionHandler:]_block_invoke_3: Invalid parameter not satisfying: aString != nil
I had same problem.
In my case I had set
[NSTextField setStringValue:nil] By mistake.
You can trace the problem in your code using crash stack log.
The log shows function call as stack start from bottom. You can search the last call of your function after which cocoa functions get called. You can say problem present at the same function.

org.eclipse.xtext.linking.impl.IllegalNodeException popups an error instead of just being written to the log

I am writing an editor based on xtext. (v 2.2.1)(Eclipse Indigo)
I have a class that extends DefaultLinkingServic and overrides the method:
public List getLinkedObjects(EObject context, EReference ref, INode node) throws IllegalNodeException.
The method throws IllegalNodeException when an object cannot be resolved.
When the exception is thrown (and it should be thrown) the error is not only written to the error log, but it causes a popup window to appear with the error:
An internal error occurred during: "Xtext validation".
org.eclipse.xtext.linking.impl.IllegalNodeException: Action App.f is not applicable for the specified arguments.
This is very problematic especiallyif the file has multiple errors which makes it impossible to edit anything in the editor, since the popup repeatedly appears on screen.
This problem is consistent in several IDE's but in others is not reproducible.
Any help would be greatly appreciated.
You are stumbling accross this bug which was already fixed for 2.3 (due June).
As a workaround, you may want to bind a custom implementation of the LazyLinkingResource and catch the IllegalNodeException in #getEObject. Alternativley you could return an empty list from your custom LinkingService instead of raising an IllegalNodeException.