- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
<font face="tahoma,arial,helvetica,sans-serif">It's like hiding all the dust under the carpet... Until the carpet can hold no more and you can't do anything about it but throw it away... ahh... success!
</font>
Admin
For production I disable assertions. And add a catch event that capture all exceptions and ignore it.
Admin
Does anyone else wonder about this:
HTTP request sent, awaiting response ... 403 Not Allowed
11:17:04 ERROR 403: Unknown Service
403 doesn't mean the requested URL (service in this case) doesn't exist, it means you don't have access... A 404 would mean it doesn't exist.
I wonder why this reponse goes from "403 Not Allowed" (which is accurate) to "403 Unknown Service" (which makes no sense)...
I write webapplications and it's quite common NOT to display errors. In case it's a serious error, show a page that explains that there was an error without going into detail. If it's an error that will have no impact on the functioning of the application, just ignore it - as far as the user is concerned. The errors will be logged however and serious errors (database unavailable 'n such) will be mailed to the administrator.
Ofcourse, the example completely ignores the error without any apparent logging, and pretending that a service executed succesfully if the service doesn't exist (or isn't allowed) is a big WTF.
Coditor
Admin
Unfortunately, that sounds all too familiar. A couple of times on my current project the first we've known of a planned change to production is when the client happens to mention that $thirdParty will be at $hostingCentre in a couple of days time.
Thankfully, we've managed to prevent it each time so far, and have expressed our disappointment at this circumvention of established process...
Admin
OT, but this reminds me of the slogan of a local gasoline company "Quality is not an option"
I'm serious.
Admin
Double post
Admin
or just rewrite this as
Admin
try{
DoSomething("Not Useful");
}
Catch(Exception E){
// Ha Ha Suckers... we sold you a bum service! Good luck finding out it doesn't work!
}
Admin
Trying to increase the readability a bit...
if (value == false && value != true)
{
// Just to be on the safe side...
return (value == false) ? false : true;
}
else if (value != false && value == true)
{
return (value == true) ? true : false;
}
else
{
// value is not false and not true... hmm, assume EOF
return EOF;
}
Admin
Admin
I won't say "What's the WTF here?", because I see it.
But I completely understand the vendor's actions. There was a big looming bug in the first place, someone tried to fix it by actually handling exceptional cases, and ended up breaking something that relied on the big looming bug. It seems to me the reasonable action is to send out a quick fix by re-adding the "bug" that has a known behaviour, rather than trying out new code - especially if a production machine is down.
Perhaps the WTF is that the vendor actually came out and admitted to the root cause?
I would expect this to be a quick fix that ultimately is replaced by handling exceptions correctly, but that could be a major change in architecture, so this seems like a reasonable duct-tape solution in the meantime.
Admin
How about this... guarantees no error EVER!!!
<font color="#0000ff" size="1">static</font><font size="1"> </font><font color="#0000ff" size="1">void</font><font size="1"> Main()
{
<font color="#008000" size="1">//Code here</font>
</font></font><font color="#0000ff" size="1">static</font><font size="1"> </font><font color="#0000ff" size="1">void</font><font size="1"> Main(){
<font color="#008000" size="1">//Code here</font>
</font><font color="#008000" size="1">//Code here</font><font color="#008000" size="1">//set up the error handler to handle EVERYTHING</font>
<font size="1"><font color="#008080" size="1">ErrorHandler</font><font size="1"> eh = </font><font color="#0000ff" size="1">new</font><font size="1"> ErrorHelper.</font><font color="#008080" size="1">ErrorHandler</font><font size="1">();
<font color="#008080" size="1">Application</font><font size="1">.Run(</font><font color="#0000ff" size="1">new</font><font size="1"> </font><font color="#008080" size="1">MainShell</font><font size="1">(eh));
}
<font color="#008080" size="1">Application</font><font size="1">.Run(</font><font color="#0000ff" size="1">new</font><font size="1"> </font><font color="#008080" size="1">MainShell</font><font size="1">(eh));
}
}
public<font size="1"> </font><font color="#0000ff" size="1">class</font><font size="1"> </font><font color="#008080" size="1">ErrorHandler</font>
</font><font size="1"> </font><font color="#0000ff" size="1">class</font><font size="1"> </font><font color="#008080" size="1">ErrorHandler</font><font size="1">{
</font><font size="1"><font color="#0000ff" size="1">public</font><font size="1"> ErrorHandler()
{
<font color="#008000" size="1">// Adds the event handler to to the main ui exeption</font>
</font></font><font color="#0000ff" size="1">public</font><font size="1"> ErrorHandler(){
<font color="#008000" size="1">// Adds the event handler to to the main ui exeption</font>
</font><font color="#008000" size="1">// Adds the event handler to to the main ui exeption</font><font size="1"><font color="#008080" size="1">Application</font><font size="1">.ThreadException += </font><font color="#0000ff" size="1">new</font><font size="1"> </font><font color="#008080" size="1">ThreadExceptionEventHandler</font><font size="1">(</font><font color="#0000ff" size="1">this</font><font size="1">.OnThreadException);</font>
</font><font color="#008080" size="1">Application</font><font size="1">.ThreadException += </font><font color="#0000ff" size="1">new</font><font size="1"> </font><font color="#008080" size="1">ThreadExceptionEventHandler</font><font size="1">(</font><font color="#0000ff" size="1">this</font><font size="1">.OnThreadException);</font><font size="1"> }</font>
<font size="1"><font color="#0000ff" size="1">public</font><font size="1"> </font><font color="#0000ff" size="1">void</font><font size="1"> OnThreadException(</font><font color="#0000ff" size="1">object</font><font size="1"> sender, </font><font color="#008080" size="1">ThreadExceptionEventArgs</font><font size="1"> t)
{
{
<font size="1">}</font>
<font size="1"></font>
Admin
Works for me! Heh.
Admin
What's all this try / catch madness? I got four words for ya.
On Error Resume Next