Thread: hehe
View Single Post
Old 05-24-2004, 08:18 AM   #9
Gambit
Forum wh0re
 
Gambit's Avatar
 
Join Date: Apr 2001
Location: DFW area, TX
Posts: 744
Send a message via ICQ to Gambit Send a message via AIM to Gambit Send a message via Yahoo to Gambit
Default

The unknown errors happen because of coding practices. Probably an exception handler. It goes something like this:
---------------
Do something
Do something else
Try {
Do something dangerous
}
Catch any errors from try block{
is error #1?
print "Don't DO that!"
go somewhere else.
is error #2?
Print "hard drive missing!"
go somewhere else.
is other error?
Print "Unknown Error!"
Show blue screen of death.
}
No errors from try block, so
Keep doing stuff
Keep doing more stuff
-------------------
Now, the stuff in the "catch" block only runs if there was an error in the "try" block, otherwise it's skipped and the program continues normally.
So a programmer writes something like this, and can't write code to cover every conceivable error or he misses one or another programmer added something to the "dangerous" code or most of the program is inside a "try" block just in case someone forgets to put one where it's really needed. Or a combination of factors.

That's how you get "unknown error" exceptions.

In general, an unknown error happens when something is not successful but you have not prepared for this particular type of failure.

For a real-world example, say your car won't start. Well, you have a spare battery in case you have a battery problem. And you have a spare starter you can change out if that's the problem. If either of those happens, you're prepared and can deal with it, even though it's a pain. But if the problem is that the fuel filter is clogged and you don't have a spare one, you're not prepared for it and may not even have a clue what is wrong.

Wow. Didn't mean to go on so long and I'll shut up now...
__________________
XMEN member
Card-carrying DTM
OKL Fish-napper


Though a program be but three lines long,
someday it will have to be maintained.
-The Tao of Programming
Gambit is offline   Reply With Quote