uncaught-exception

Can you explain why the exception is not caught if I do not await an async task?

巧了我就是萌 提交于 2019-12-22 11:03:11
问题 Starting from an issue I had on my code, I've created this simple app to recreate the problem: private async void button1_Click(object sender, EventArgs e) { Task task = Task.Run(() => { TestWork(); }); try { await task; MessageBox.Show("Exception uncaught!"); } catch (Exception) { MessageBox.Show("Exception caught!"); } } private async void button2_Click(object sender, EventArgs e) { Task task = TestWork(); try { await task; MessageBox.Show("Exception uncaught!"); } catch (Exception) {

How to debug “uncaught exception: undefined (unknown)” in Firefox

妖精的绣舞 提交于 2019-12-21 07:14:37
问题 I have this line come up in the console, only in Firefox, from my JavaScript application I'm developing: It seems relatively harmless, but I'm curious if there's any way to deduce its origin, because it must come from somewhere, even if it claims 'unknown'. Wrapping the entire script in a try/catch block and toggling Firefox's "Pause on Exception" setting doesn't do anything, which seems to imply it's a special exception? I have some ideas what parts of my code might be causing it that are

Android Global Error Handling and Reporting Activity

对着背影说爱祢 提交于 2019-12-18 17:27:56
问题 I there any way to register a global error handler that will prevent application from crashing? Crashing reporting is described here: How do I obtain crash-data from my Android application?. One thought I had was to extend these solutions to take in the application context so a redirect to a particular reporting activity could be made? But not sure if the application context is valid at this point once there is a crash to report? But how can you redirect user to a global error message

Android Global Error Handling and Reporting Activity

有些话、适合烂在心里 提交于 2019-12-18 17:27:19
问题 I there any way to register a global error handler that will prevent application from crashing? Crashing reporting is described here: How do I obtain crash-data from my Android application?. One thought I had was to extend these solutions to take in the application context so a redirect to a particular reporting activity could be made? But not sure if the application context is valid at this point once there is a crash to report? But how can you redirect user to a global error message

Why bother with setting the “sun.awt.exception.handler” property?

人走茶凉 提交于 2019-12-18 03:38:45
问题 Here's some code that catches an exception thrown on the Event Dispatch Thread: package com.ndh.swingjunk; import java.awt.EventQueue; import javax.swing.JFrame; public class EntryPoint { public static void main(String[] args) { Thread.setDefaultUncaughtExceptionHandler(new MyExceptionHandler()); // System.setProperty("sun.awt.exception.handler", MyExceptionHandler.class.getName()); EventQueue.invokeLater(new Runnable() { public void run() { new SomeWindow("foo").setVisible(true); } }); } }

Uncaught exception when calling Google maps directionsService

别来无恙 提交于 2019-12-13 06:51:15
问题 I am getting an Uncaught InvalidValueError: in property origin: not a string; and not a LatLng or LatLngLiteral: not an Object error when I call the Google maps directions service - even so, the directions seem to be added to the map? Here is the function that calls the directions service between the current location ( currentPos ) and a location not too far away ( LatLng(52.705151, -2.741861) ) function calcRoute() { var start = currentPos; var end = new google.maps.LatLng(52.705151, -2

nodejs object declaration and immediate shorthand if statement crashes the app

我怕爱的太早我们不能终老 提交于 2019-12-11 20:44:16
问题 Can anyone give a comprehensive reason as to why the following node.js script would be crashing? var _ = require("underscore"); var foo = { bar: 123 } (!_.isNull(foo.bar)?foo.bar = true:""); The error it produces is: TypeError: Cannot read property 'bar' of undefined at Object.<anonymous> (/Users/blahsocks/test_ob.js:7:15) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at

Which error will be handled by express error and which by uncaughtException error handler?

一个人想着一个人 提交于 2019-12-11 13:46:57
问题 In my services using express nodejs. I knew about the express error handler, the callback function with err first app.use(function(err, req, res, next) And We can handle the uncaughtException also by process.on('uncaughtException', function(err) {} In fact, some uncaughtException will go to express error handler not uncaughtException handler. Please help to tell me which error will be handled by express, which by uncaughtException handler? Many thanks 回答1: When you throw an exception ( throw

Uncaught TypeError: Can not set propery 'FUNCTION_NAME' of undefined for widget implementation

旧城冷巷雨未停 提交于 2019-12-11 03:08:13
问题 I am trying to develop a jQuery widget which can be embedded on any site. Following is the script code: (function($) { var jQuery; if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.6.2') { var script_tag = document.createElement('script'); script_tag.setAttribute("type","text/javascript"); script_tag.setAttribute("src","http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"); script_tag.onload = scriptLoadHandler; script_tag.onreadystatechange = function () { if

Do errors thrown within UncaughtExceptionHandler get swallowed?

为君一笑 提交于 2019-12-10 02:48:48
问题 Thread.UncaughtExceptionHandler states that when the method which handles uncaught exceptions itself throws an exception, that exception will be ignored: void uncaughtException (Thread t, Throwable e): Method invoked when the given thread terminates due to the given uncaught exception. Any exception thrown by this method will be ignored by the Java Virtual Machine. However when I tested it, the JVM did not ignore the exceptions handled by the uncaught exception handler`: public static void