Tag Info

New answers tagged

0

There are programming errors, and so-called error messages depending on something outside your application. As an example: If my code tries to open a file and receives an error message, there wasn't really an error: The OS just informs me that for some reason the file could not be opened. Assuming that the OS was correct, this isn't an error, but one of ...


0

The API should do whatever it can to give the application the necessary information how to proceed. But for the user, the message is most likely: None - for things like updates, prefetch etc. or where retrying helps. Tell them "it didn't work". Tell them "it didn't work, it might work later". Tell them "it didn't work, here's what you can do to fix it" ...


-1

It depends on the language implementation of exceptions. Exceptions allow you to take some action to prevent damage to data or to cleanly release resources in the event your system enters an unanticipated state or condition. This is different from error handling which are condition you can anticipate. My philosophy is that you should have as little exception ...


1

I've been developing extensible software for a long time now. I've also been on the other side. One thing I've learned is that you want libraries you use to "Fail fast". What that means is, it should break my software as soon as possible if something is wrong. If you can (which in this case I presume you can't) break at compile time. If not, throw an ...


2

Validation of input parameters/data should be performed whenever the data can come from an untrusted source. To be on the safe side, if anyone outside the development team can supply data to an interface, then that interface should validate its inputs. The more interesting part of the question is what to do when the validation finds a problem. First of ...


1

It depends on how much of a performance hit you can reasonably accept when throwing the exception. If it only happens once, it might not be a big deal. If it happens every line of the file, it could be a huge problem. Normally exceptions are thrown when something happens that you can't do anything about, and execution is stopped.



Top 50 recent answers are included