All Questions
Tagged with exception-handling or error-handling
822 questions
4
votes
3
answers
3k
views
Handling optimistic concurrency violations
I'm trying to establish a concurrency violation verification in my SQL updates using C# and raw SQL.
What I'm doing now is storing the TimeStamp value in a ...
4
votes
1
answer
482
views
Is there a better way to test for the exception conditions?
This method assigns the value of a specified column in a DataRow to specified property in an object.
I have 3 conditionals handling exceptions, and I want these ...
8
votes
1
answer
3k
views
Simplifying exception handling on Enumerators
I have a files search function that iterates over a given directory until a given depth is reached and returns the found files. I did this via the Enumerate methods of the Directory class and yield ...
3
votes
3
answers
2k
views
Reading image from jar
I am using this static method in my class IconManager to read an image from jar file. imagepath is a relative path to the image.
...
1
vote
1
answer
1k
views
Best way to handle repetitive error code or return value [closed]
I have a wrapper which interacts with a third party component. In Each function i am performing the operation if it the component is initialized.
I have other function to check the errorCode and ...
3
votes
2
answers
562
views
Storing and iterating over multiple NSError pointers
How would you refactor this kind of code? I've unsuccessfully tried several approaches (NSArray, NSPointerArray, plain C array), but always ran into pointer type checking error.
...
2
votes
1
answer
366
views
Suggestions for improving error handling [closed]
I am interested in finding out what is the correct way of implementing error handling for this situation in C#.
The system tries to do an operation. If the operation succeeded (returns a non-error ...
1
vote
1
answer
551
views
PHP - Is this proper use of exceptions for error handling within classes?
I've searched plenty on this topic and have gotten a lot of good (but different) results. Some of the results weren't quite related and it does seem to be a matter of preference in the end, but I'm ...
3
votes
2
answers
240
views
Add events dispatching for ActionScript framework Robotlegs
I have the following function in a Service class
...
1
vote
3
answers
161
views
I think I'm not using Try Except properly in this Python code [closed]
Please offer some advice for this code. It all works, but I know that its messy and I don't think the Exception catching is doing what I want it to. Thanks in advance for any and all advice...
<...
0
votes
1
answer
108
views
uplifitng return value error reporting to Exception based error reporting
In Framework Design guideline book there is a chapter about Exception and they talk about return-value-based error reporting and exception based error reporting and the fact that we in a O.O language ...
3
votes
2
answers
1k
views
Is this right way to implement Abort, Retry and Ignore activity pattern?
I've a bunch of sequential activities. These are long running. Once an activity is complete, it can't be rolled back. Now something deep down the line fails. Now I've few options
Report this to end ...
2
votes
1
answer
75
views
How can I improve CreateGenre() function?
I use this function in my wordpress site to add genres to an album:
What is it that makes this code so bulky?
Is it have for the server or it just looks like?
...
2
votes
2
answers
212
views
extending Exception to allow for auto appending class name on exception message
Got this idea from the php.net website on extending exceptions. The main thing I wanted with this was to have the exception name auto imprinted on the exception message, so I wouldn't have to write it ...
3
votes
2
answers
287
views
Is it acceptable to pass an Exception into a function that then may or may not throw it?
I am still getting the hang of Exception Handling in PHP; Here is the scenario where I am using the convention:
There are times where I have a SQL query that I need to turn into an object, so I wrote ...
3
votes
3
answers
15k
views
Exception handling continuing the excecution
This code is for continuing the execution after an exception, and this is ugly:
...
6
votes
2
answers
294
views
Asserting when cleanup is required
I've been looking at ways to use asserts in programs that must do some kind of cleanup on fatal errors, and have arrived at the following pattern (PROJECT being replaced by the name of the project):
<...
3
votes
2
answers
188
views
2
votes
1
answer
7k
views
Validating files and returning errors messages/boolean values
I am writing simple file validator for my java ee app and I am stack with my class api. I need specific error descriptions, but also I would like to have boolean values indicating whether file is ...
2
votes
1
answer
237
views
Is This a Sufficient Demonstration of the Effects of Exception Handling [closed]
We have some developers in house that believe it is best practice to use exception handing as flow control, as well as, thinking that catching and re-throwing exceptions is effective error handling.
...
4
votes
2
answers
474
views
Open database and hande errors
How to make this code better?
...