exception

C# ASP.Net: Exception (some times only) during long database operation

我的梦境 提交于 2020-01-11 07:47:08
问题 We have a ASP.Net web application that connects to its business layer using WCF. Sometimes, I am getting exception when it is performing a huge operation. The interesting part is when I ran it for the first time it was successful. Afterwards it is throwing exception. Exception: The socket connection was aborted. The operation is that it uploads zipcodes into database tables from a csv file. First we read from csv file and make a single lengthy string of zipcodes. This is passed to the stored

Is it a good practice to subclass from NSException for app-specific exceptions?

为君一笑 提交于 2020-01-11 07:09:23
问题 Is it a good practice to subclass from NSException for app-specific exceptions? That way everything is centralized one class for easier management. e.g. @interface AppException : NSException + (AppException *)InvalidSomething; + (AppException *)InvalidSomething2; @end 回答1: No, it's not good to subclass NSException because it's a class that doesn't need to be any more specific than it already is. In addition, subclasses, as is noted in the documentation, may not receive proper call stack

Is it a good practice to subclass from NSException for app-specific exceptions?

只愿长相守 提交于 2020-01-11 07:09:10
问题 Is it a good practice to subclass from NSException for app-specific exceptions? That way everything is centralized one class for easier management. e.g. @interface AppException : NSException + (AppException *)InvalidSomething; + (AppException *)InvalidSomething2; @end 回答1: No, it's not good to subclass NSException because it's a class that doesn't need to be any more specific than it already is. In addition, subclasses, as is noted in the documentation, may not receive proper call stack

Getting External Exception C0000006 in D2006 app - how can I force delphi to load the whole executable?

 ̄綄美尐妖づ 提交于 2020-01-11 06:45:13
问题 I get this occasionally when exiting my app - my app is running the EXE over a network. I understand it's a page fault when part of the EXE is loaded on demand. I have also observed it in the OnDrawCell method of a TDrawGrid, so I'm mystified how that might have caused a page load. Also, the exception kept happening. So my questions: Can Error C0000006 result from other causes? I have made fairly major changes to the way the app manages memory, though nothing out of the ordinary, and I'm

Memory deallocation and exceptions

微笑、不失礼 提交于 2020-01-11 05:15:09
问题 I have a question regarding memory deallocation and exceptions. when I use delete to delete an object created on the heap . If an exception occurs before this delete is the memory going to leak or this delete is going to execute ? 回答1: This depends on where that delete is. If it's inside the catch that catches the exception, it might invoke. try { f(); // throws } catch( ... ) { delete p; // will delete } If it's after the catch that catches the exception and that catch doesn't return from

Exception and Inheritance in Java

风格不统一 提交于 2020-01-10 23:24:11
问题 Suppose we have this problem public class Father{ public void method1(){...} } public class Child1 extends Father{ public void method1() throws Exception{ super.method1(); ... } } Child1 extends Father and overrides method1 but given the implementation Child1.method1 now throws a exception. This won't compile as the overriding method can't throw new exceptions. What is the best solution? Propagate the required exception to the Father . To me this is against encapsulation, inheritance and

NetworkOnMainThreadException on Facebook Login with Phonegap 1.6.0

拈花ヽ惹草 提交于 2020-01-10 19:33:10
问题 I am currently creating an application using Phonegap 1.6.0 and Sencha Touch 1.1. Recently, when testing on a smartphone with Android 4.0.4, we discovered that the Facebook Login doesn't quite work as expected. We are using the Phonegap Facebook Plugin located here with patches for Cordova. What happens is that, once we try logging into Facebook on a Smartphone with Android Honeycomb or higher, the application launches a NetworkOnMainThreadException because Network operations aren't permitted

Why is throwing a checked exception type allowed in this case?

心不动则不痛 提交于 2020-01-10 17:33:09
问题 I noticed by accident that this throw statement (extracted from some more complex code) compiles: void foo() { try { } catch (Throwable t) { throw t; } } For a brief but happy moment I thought that checked exceptions had finally decided to just die already, but it still gets uppity at this: void foo() { try { } catch (Throwable t) { Throwable t1 = t; throw t1; } } The try block doesn't have to be empty; it seems it can have code so long as that code doesn't throw a checked exception. That

Django + FastCGI - randomly raising OperationalError

我的梦境 提交于 2020-01-10 14:36:30
问题 I'm running a Django application. Had it under Apache + mod_python before, and it was all OK. Switched to Lighttpd + FastCGI. Now I randomly get the following exception (neither the place nor the time where it appears seem to be predictable). Since it's random, and it appears only after switching to FastCGI, I assume it has something to do with some settings. Found a few results when googleing, but they seem to be related to setting maxrequests=1. However, I use the default, which is 0. Any

How should I correctly handle exceptions in Python3

ぐ巨炮叔叔 提交于 2020-01-10 14:13:20
问题 I can't understand what sort of exceptions I should handle 'here and now', and what sort of exceptions I should re-raise or just don't handle here, and what to do with them later (on higher tier). For example: I wrote client/server application using python3 with ssl communication. Client is supposed to verify files on any differences on them, and if diff exists then it should send this 'updated' file to server. class BasicConnection: #blablabla def sendMessage(self, sock, url, port,