If I throw an exception:
throw Cat("Minoo");
Then I catch and rethrow with ... at some lower level in the call stack:
catch(...)
{
throw;
}
Then at some other lower level in the call stack I try to catch with:
catch(const Cat& c)
{
//Will it enter here, and if so will c be valid data?
}
catch(...)
{
}
...
I'm trying to implement drag and drop behaviour between a bunch of ListViews. I've found this solution that uses attached properties: http://www.beacosta.com/blog/?p=53
But whenever I try to perform a drag and drop, I get the following error message in the debug log:
A first chance exception of type 'System.IndexOutOfRangeException...
I have a small WinForms app that utilizes a BackgroundWorker object to perform a long-running operation.
The background operation throws occasional exceptions, typically when somebody has a file open that is being recreated.
Regardless of whether the code is run from the IDE or not .NET pops up an error dialog informing the user that a...
"The major difference between a thing
that might go wrong and a thing that
cannot possibly go wrong is that when
a thing that cannot possibly go wrong
goes wrong it usually turns out to be
impossible to get at or repair."
-Douglas Adams
I have an class FileItems. FileItems constructor takes a file, and throws an exce...
I have a XIB file with a UITextView, which I'm associating with a UITextView* outlet in my controller:
@interface MyController : UIViewController <UITextViewDelegate> {
IBOutlet UITextView *textView;
}
@property (nonatomic, retain) IBOutlet UITextView *textView;
I've aded the prototype in desperation, I've not implemented any o...
Basically, my question is short and sweet: Is the following a bad idea (encapsulating and rethrowing ex.InnerException instead of ex)
(There's a similar question here, but not quite... I want to reencapsulate the InnerException, so the stack trace is preserved without reflecting on internals)
public abstract class RpcProvider
{
pub...
I'm developing an application that is reading and writing a lot (but synchronously, though) to a certain file on disk. However, how larger the file gets, the more often I get the following IOException:
The requested operation cannot be
performed on a file with a user-mapped
section open.
occuring from:
at System.IO.__Error.Win...
I have a background worker wich can be cancelled.
The normal flows interrupt itself when the CancelPending variable turns to true (responding to user interaction on UI wich call worker.CancelAsynch() ) , exceptions are thrown because if that (since normal flow is interrupted, lots of null ref exception are thrown)
So when the worker r...
I ran into an interesting dilemna today. I have a function that handles information and checks for duplicate values, then returns the next number that is not a duplicate. So, I have something like this:
Public Function GetNextNonDuplicateNumber(NumberToCheck as Long) as Long
//the non-duplicate the function will return
Dim...
I'm getting this error message whiile running a Webservice I'm working on. it builds, but this happens when I Invoke:
File or assembly name (Redacted).Framework, or one of its dependencies, was not found
The stack trace shows that between my code and the target of the exception, there are 3 referenced DLLs and 4 layers of System.Refl...
I was told that in Java, unchecked exceptions can be caught in a try block, but if it's caught, isn't it called a checked exception?
...
Is there a way to annotate a method so all exceptions thrown are converted to runtime exception automagically?
@MagicAnnotation
// no throws clause!
void foo()
{
throw new Exception("bar")'
}
...
Hi all,
I have no idea what's wrong here, so you guys are my last chance:
When trying to start my JUnit-Test out of Eclipse, I get a "ClassNotFoundException". When running "mvn test" from console - everything works fine. Also, there are no problems reported in Eclipse.
My project structure is the following:
parent project (pom-packa...
When calling functions that always throw from a function returning a value, the compiler often warns that not all control paths return a value. Legitimately so.
void AlwaysThrows() { throw "something"; }
bool foo()
{
if (cond)
AlwaysThrows();
else
return true; // Warning C4715 here
}
Is there a way to tell the...
Is there any way to get at least someinformation inside of here?
...
catch(...)
{
std::cerr<<"Unhandled exception"<<std::endl;
}
I have this as a last resort around all my code. Would it be better to let it crash, because then I at least could get a crash report?
...
Do all boost exceptions derive from std::exception? If not do they all derive from some base exception class?
...
Hello
If function or class method throws an exception it is considered to be a good practice to signify this in function's signature. I.e.
bool
some_func() throw (myExc)
{
...
if (shit_happens) {
throw myExc("shit happens");
}
...
}
My should we do this ? What are the advantages (or may be disadvantages) of su...
I'm trying to write code that will load an image from a resource, and then crop it. This code works when I do all, or part, of it in XAML. I want to switch from all-XAML to all-code, so I can reuse this more than one place, with different Uris.
But when I try to do the same thing in code, I get a DirectoryNotFoundException, because sudd...
In dotNet a line throws an exception and is caught, how can I figure out which line in which file threw the exception? Seems relatively straightforward, but I can't figure it out...
...
in c#, i am deserializing an object of a type that implements IDisposable with the following statement (for illustration only).
XmlSerializer s = new XmlSerializer(typeof(MyDisposable))
MyDisposable o = (MyDispoable)s.Deserialize(filepath);
afaik, the serializer tries to construct the object using the default ctor and assigning all pu...