In an application I work on, any business logic error causes an exception to be thrown, and the calling code handles the exception. This pattern is used throughout the application and works well.
I have a situation where I will be attempting to execute a number of business tasks from inside the business layer. The requirement for th...
Hi Folks,
I have a sequential workflow with a number of Activities. One of these activities needs to access my paid S3 account. It works fine, but to be cautious, I would like to make sure it can handle unexpected situations, such as 'Host not found' or some timeout, etc.
So .. i would normally put the code inside a TRY / CATCH. That's...
I noticed that EStackOverflow, as defined in SysUtils.pas is marked as deprecated in Delphi 2009. I checked and it was also marked as deprecated in 2007. I have a Delphi 7 install disk here, but I thought I would ask if anyone knows when it was deprecated.
Additionally, does anyone know why, and what replaces it? I wrote a test appli...
I'm currently refactoring code to replace Convert.To's to TryParse.
I've come across the following bit of code which is creating and assigning a property to an object.
List<Person> list = new List<Person>();
foreach (DataRow row in dt.Rows)
{
var p = new Person{ RecordID = Convert.ToInt32(row["ContactID"]) };
list.Add(p);
}...
The Exception class in Delphi 2009 received a number of new features. A number of them are related to getting a stacktrace:
property StackTrace: string *read* GetStackTrace;
property StackInfo: Pointer read FStackInfo;
class var GetExceptionStackInfoProc: function (P: PExceptionRecord): Pointer;
class var GetStackInfoStringProc: funct...
Hypothetical situation: let's say I have a 3rd party .net assembly being used in the ASP.Net web system that I'm working on that just kinda crashes every now and then. When it does so, all calls to it throw exceptions until the system is rebooted. This is, obviously, a little sub-optimal.
Is there a way to reboot just that assembly fr...
I need to add localization to the exceptions thrown by my application as a lot are ApplicationExceptions and handled and logged to an error report. Ideally I want to create a new Exception, imheriting from ApplicationException that I can pass the resource key as well as arguments to, so that the exception messsage can be built up from t...
Where should I be logging exceptions? At the data service tier(ExecuteDataSet, etc.) and/or at the data access layer and/or at the business layer?
...
When A Python exception is thrown by code that spans multiple lines, e.g.:
myfoos = [foo("bar",
"baz",
"quux",
i) for i in range(10)]
Python will report the line number of the last line, and will show the code fragment from that line:
Traceback (most recent call last):
File "test....
I am working on a J2ME project that spawns worker threads for numerous tasks such as downloading HTTP content. The basic thread layout is similar to most java apps--there is a main UI thread and worker threads spawned to do stuff behind the scenes. My question is what is the best way to handle exceptions that occur in the worker threads?...
I've been utilizing NHibernate 2.0.1.4000 on all current .NET 3.5 SP1 projects and have had no problems with any other queries (utilizing either the Query or Criteria APIs), until some new business logic dictated the necessity of a new query in this particular project against the application's database that needs to retrieve records with...
Hi all,
I'm getting an exception which says "Access Denied" when the users permissions are sufficient, how do I catch an exception and check for "Access Denied" so that I can show the user a friendlier "Sorry Access Denied" message?
Thanks
Beginner :-)
...
Some days ago I realized that PrintWriter (as well as PrintStream) never throw an IOException when writing, flushing or closing.
Instead it sets an internal flag (trouble=true) when an error occurs.
It's not possible to get the exact exception, but only if there was some exception (checkError()).
My question is: why would one want to h...
Is there any way to direct C# to ignore NullReferenceException (or any specific exception for that matter) for a set of statements.
This is useful when trying to read properties from a deserialized object that may contain many null objects in it.
Having a helper method to check for null could be one way but I'm looking for something clo...
Would it be benefical to add a generic way to add info to a Throwable without creating a new Throwable?
I often see code like this:
try {
foo();
} catch(Exception e) {
throw new Exception(e.getMessage() + " extra info=" + blah, e);
}
Would it be better to instead add Throwable.setProperty(String key, String value) so that the cod...
The Oracle community has a several support sites (here and here) that have lists of errors. The first site even has suggestions for how to fix them.
Does anyone know of an equivalent list for Microsoft COM, preferably with Office Interop issues?
...
If a method checks it's input and detects illegal input, what should it do: Raise an exception (or use another error-mechanism) or do nothing/ignoring on the wrong input?
In Java the HashTable-class throws an NullPointerException if given null-references as parameter. This is sometimes annoying, but I think it may have advantages, becau...
Host: GoDaddy Shared Hosting
Trust Level: Medium
The following happens after I submit a valid user/pass. The database has read/write permissions and when I remove the login requirement on an admin page that updates the database work as expected.
Has anyone else had this issue or know what the problem is?
Anyone?
Server Error in '/' ...
Since there is no finally in C++ you have to use the RAII design pattern instead, if you want your code to be exception safe. One way to do this is by using the destructor of a local class like this:
void foo() {
struct Finally {
~Finally() { /* cleanup code */ }
} finalizer();
// ...code that might throw an exceptio...
We get an abort when a C++ exception is thrown when running code compiled with -pthread.
Platform: AIX 5.3 technical level 8
Compiler: gcc 3.4.6
Linker: AIX linker 1.65.2.4
Test Code:
// exception.cpp
#include <iostream>
class MyException
{
public:
MyException(){}
virtual ~MyException(){};
};
void gTest()
{
t...