An exception is a rarely occurring (exceptional!) condition that requires deviation from the program's normal flow.
2
votes
1answer
105 views
Is there anything wrong with my self-implemented C++ exception class?
I wrote my own exception class, deriving from std::runtime_error to have Error-IDs, timestamps and inner exceptions.
It seems to work, but are there any drawbacks?
The only thing I see is the ...
0
votes
0answers
49 views
Model View Control Issue: Null Pointer Initialization Question [closed]
Good morning again. This is David. Please, I need an urgent help regarding control model view where I making a code that uniquely separating into groups:
An Activity Java Class to Display the ...
9
votes
13answers
846 views
Can I return a null in a function if something goes wrong?
Lets say I have a function that should return me the information about all textfiles in a folder:
public static FileInfo[] GetTxtFiles()
{
//...
FileInfo[] files = directory.GetFiles("*.txt");
...
2
votes
1answer
118 views
Suggestions for improving error handling
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 ...
9
votes
3answers
470 views
Is it better practice to have void method throw an exception or to have the method return a boolean?
This falls straight into the same category with the recent "Is it better practice to return if false or execute an if statement if true?" question.
Often, while writing code, I find myself presented ...
2
votes
2answers
268 views
HttpClient error handling
I would be happy to hear feedback on my implementation of httpclient. I am not so strong with error handling so I want to improve. My thought process behind this was that IOExceptions can be ...
1
vote
1answer
77 views
Rails stylistic exception and bang usage
Question whether I should be throwing exceptions in the below model code (and rescuing in the controller - rescues not implemented below) or returning nil (in both or one of the exception cases). ...
0
votes
1answer
49 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 ...
1
vote
1answer
91 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
2answers
963 views
Is this the wrong way to handle AggregateException with Tasks
I'm seeing a lot of code like this at my new site
try
{
Task.Factory.StartNew(() =>
{
...
});
}
catch ...
0
votes
0answers
100 views
I'm receiving NoClassDefFoundError [closed]
I'm receiving this error and don't have a clue of what is going on here.
My code:
ConnectionPool.java:
package data;
import java.sql.*;
import javax.sql.DataSource;
import ...
2
votes
3answers
137 views
Exception handling continuing the excecution
This code is for continuing the execution after an exception, and this is ugly:
int step=0;
do{
try{
switch(step)
{
case 0:
...
2
votes
1answer
214 views
Simple factory pattern in scala (attempting to restrict use of new)
I am a Scala newbie and attempting to improve my skills. I have decided to be playful about it and work to do a conversion of the spaceinvaders game supplied with the LWJGL. It consists of 10 Java ...
2
votes
1answer
176 views
Critical review of a Simple Class
public partial class CreateAdmin : System.Web.UI.Page
{
#region Events.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
...
3
votes
5answers
574 views
C++ try … catch inside or outside a loop when rethrowing it
try
{
for (int i = 0; i < n; ++i)
{
nothrow_stuff();
could_raise_an_exception();
nothrow_stuff();
}
}
catch (...)
{
ensure_everything_is_fine();
throw;
}
...