An exception is an occurrence in an application process that requires deviation from the program's normal flow.
17
votes
2answers
458 views
Python Forgiveness vs. Permission and Duck Typing
In Python, I often hear that it is better to "beg forgiveness" (exception catching) instead of "ask permission" (type/condition checking). In regards to enforcing duck typing in Python, is this
try:
...
4
votes
3answers
103 views
Designing exceptions for conversion failures
Suppose there are some methods to convert from "X" to "Y" and vice versa; the conversion may fail in some cases, and exceptions are used to signal conversion errors in those cases.
Which would be the ...
8
votes
2answers
236 views
Use an else after exception (or not)
Consider this bit of code:
if (x == 1)
{
throw "no good; aborting" ;
}
[... more code ...]
Now consider this code:
if (x == 1)
{
throw "no good; aborting" ;
}
else
{
[... more code ...]
}
...
3
votes
1answer
109 views
Where should I handle fatal exceptions
For example, I have a controller that loads a file and hands it over to the processing. Should I handle the exception in the file loader and return Null if something is wrong, or should I throw the ...
2
votes
4answers
117 views
What is the best way to go about testing that we handle failures appropriately?
we're working on error handling in an application. We try to have fairly good automated test coverage. One big problem though is that we don't really know of a way to test some of our error handling.
...
1
vote
3answers
128 views
Best method in PHP for the Error Handling ? Convert all PHP errors (warnings notices etc) to exceptions?
What is the best method in PHP for the Error Handling ?
is there a way in PHP to Convert all PHP errors (warnings notices etc) to exceptions ?
what the best way/practise to error handling ?
...
34
votes
10answers
2k views
Why are exceptions considered better than explicit error testing? [closed]
Possible Duplicate:
Defensive Programming vs Exception Handling?
if/else statements or exceptions
I often come across heated blog posts where the author uses the argument: "exceptions vs ...
18
votes
9answers
2k views
Is catching general exceptions really a bad thing?
I typically agree with most code analysis warnings, and I try to adhere to them. However, I'm having a harder time with this one:
CA1031: Do not catch general exception types
I understand the ...
34
votes
12answers
2k views
Why are errors named as “Exception” but not as “Error” in programming languages?
I've been thinking about that for quite a while actually. I am not a native english speaker myself but still I have years of programming experience and I always asked me this. Why is it named as ...
0
votes
1answer
99 views
Generic way of handling exceptions in windows phone? [closed]
I mean what are some of the ways other programmers deal with exception for example, when an error occurs when accessing a web service for say. If an example cant be given for windows phone, give the ...
5
votes
1answer
289 views
Best exception handling practices or recommendations?
I think the two main problems with my programs are my code structure/organization and my error handling. I'm reading Code Complete 2, but I need something to read for working with potential problems.
...
1
vote
3answers
169 views
Good practice or service for monitoring unhandled application errors for a small organization
I'm working with multiple software with varying ways of monitoring for errors. When I make software, I usually send email with the stack trace to admins(usually me). Some customer software is ...
7
votes
5answers
419 views
Maybe monad vs exceptions
I wonder what are the advantages of Maybe monad over exceptions? It looks like Maybe is just explicit (and rather space-consuming) way of try..catch syntax.
update Please note that I'm intentionally ...
1
vote
2answers
235 views
Exception hierarchy design
In my company we are building a webapp containing serveral central services that we design ourselves and then specify as interfaces. I.e. the interfaces are application specific and they are then ...
3
votes
3answers
118 views
Using Exception Emails as a System Status Indicator
I'm working through our bug list today and I'm trying to clear up/fix issues that we commonly receive exception emails for. Although all the exceptions (so far) are handled, some don't actually ...