exception

TaskScheduler.UnobservedTaskException never gets called

只谈情不闲聊 提交于 2020-01-10 13:52:28
问题 Based on my research, I have learned the following: TaskScheduler.UnobservedTaskException must wait for the task to be garbage collected before that task's unobserved exception will bubble up to the UnobservedTaskException event. If you're using Task.Wait() , it'll never get called anyway, because you're blocking on an impending result from the Task, hence the exception will be thrown on Task.Wait() rather than bubble up to the UnobservedException event. Calling GC.Collect() manually is

How do I fix the error “Only one usage of each socket address (protocol/network address/port) is normally permitted”?

故事扮演 提交于 2020-01-10 08:09:28
问题 I've done a lot of googling but not had much luck with my issues. I am new to network programming and trying to learn, I've attempted to set up a simple server & client that communicate (following an online tutorial located here -> http://tech.pro/tutorial/704/csharp-tutorial-simple-threaded-tcp-server) The issue I'm having is that I keep getting the exception "Only one usage of each socket address (protocol/network address/port) is normally permitted" when trying to start the TcpListener on

PDOException not being caught?

我们两清 提交于 2020-01-10 05:41:05
问题 I'm getting the following error in PHP: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'localhost' (10061)' in C:\xampp\htdocs\project\Service\Database.class.php:26 Stack trace: #0 C:\xampp\htdocs\project\Service\Database.class.php(26): PDO->__construct('mysql:host=loca...', 'root', '', Array) #1 C:\xampp\htdocs\project\Service\Database.class.php(54): Service\Database::initialize() #2 C:\xampp\htdocs\project\index.php(15):

Exception handling, catch causes while loop to stop

别来无恙 提交于 2020-01-10 05:24:39
问题 I have a file that I need to read, print out the integers, catch exception and continue with the next integer to display, and so on until there are no more integers. The file contains: 12 5 sd 67 4 cy I want it to display: 12 5 Input error 67 4 Input error However, it only gives me 12, 5, followed by input error, and it stops. I've tried putting everything into a while loop and it loops endlessly with the input exception. public static void readNumbers() { File inputFile = new File ("C:/users

How can I configure call depth in PowerShell?

橙三吉。 提交于 2020-01-10 05:11:12
问题 I was just trying things in PowerShell and got an error about call depth being set to 1000 in some test recursive function. I looked on the Internet for some information and found that this is due to error handling in PowerShell (if I got it right): The recursion depth limit is fixed in version 1. Deep recursion was causing problems in 64-bit mode because of the way exceptions were being processed. It was causing cascading out-of-memory errors. The net result was that we hard-limited the

java.lang.ArrayIndexOutOfBoundsException: length=0; index=0 - Database Reading - Android

情到浓时终转凉″ 提交于 2020-01-10 03:01:52
问题 I created a method that reads data from a database and puts it in a String array. Android Studio doesn't give syntax errors but when i launch my app the log says: 03-19 16:31:20.938 2518-2518/com.mms.dailypill E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.mms.dailypill, PID: 2518 java.lang.ArrayIndexOutOfBoundsException: length=0; index=0 at com.mms.dailypill.DBManager.getMedicines(DBManager.java:56) The method code is: public String[] getMedicines() { SQLiteDatabase db = dbManager

JavaFX Exception in thread “main” java.lang.NoClassDefFoundError: javafx/application/Application

大兔子大兔子 提交于 2020-01-09 06:46:28
问题 I'm getting this error Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Ap plication at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java

Why does my applet get a java.security.AccessControlException: access denied (java.net.SocketPermission …), and how can I avoid it?

此生再无相见时 提交于 2020-01-09 05:22:07
问题 We are clueless about why my client is encountering a Java Security exception in Safari. Could anyone help? The exception occurs reliably in Safari on Windows. This involves a Java applet. The exception also occurs with Firefox and IE8 on Windows Vista. Here are the steps to reproduce: Open Safari on Windows Click here: http://www.cengraving.com/s/item?itemId=CH003 Click "Customize" (at bottom of screen) After the "Instant Proof" page loads, click "Add to cart." Full stack trace: java

Difference between a C++ exception and Structured Exception

巧了我就是萌 提交于 2020-01-09 04:22:27
问题 Can someone explain the difference between a C++ exception and a structured exception in MFC? 回答1: You actually have three mechanisms: C++ exceptions, implemented by the compiler ( try / catch ) Structured Exception Handling (SEH), provided by Windows ( __try / __except ) MFC exception macros ( TRY , CATCH - built on top of SEH / C++ exceptions - see also TheUndeadFish's comment) C++ exceptions usually guarantee automatic cleanup during stack unwinding (i.e. destructors of local objects run),

Best way to check for inner exception?

老子叫甜甜 提交于 2020-01-09 04:13:40
问题 I know sometimes innerException is null So the following might fail: repEvent.InnerException = ex.InnerException.Message; Is there a quick ternary way to check if innerException is null or not? 回答1: Is this what you are looking for? String innerMessage = (ex.InnerException != null) ? ex.InnerException.Message : ""; 回答2: Great answers so far. On a similar, but different note, sometimes there is more than one level of nested exceptions. If you want to get the root exception that was originally