Perhaps some exception handling is in order?

Locked
User avatar
Kalium
Sir Bugsalot
Joined: Fri Oct 03, 2003 11:17 pm
Location: Plymouth, Michigan
Org Profile

Perhaps some exception handling is in order?

Post by Kalium » Thu Jun 03, 2004 5:59 pm

This idea was promped by the trouble caused here.

The error itself:

Code: Select all

Warning: OpenDir: No such file or directory (errno 2) in /var/www/downloadlocal.php on line 38

Warning: Supplied argument is not a valid Directory resource in /var/www/downloadlocal.php on line 39
Now, it seems to me that this error could easily be caught server-side. For some reason, it seems to cause an infinite server loop. If it were caught, several things would be possible:
1) No nasty loop.
2) No nasty error page. Nice looking "an error has occured" page would be possible instead.
3) With the details available (filename, where it was supposed to be, etc.) the server could automagically notify any/all admins. Hell, with enough work it could grep the Donut for videos with that name, and include the paths of those in the notification.

Now, I can't see any reason why this would be difficult (I'm assuming PHP has error handling, which I'm pretty sure it does). The only difficulty would lie in testing it and and changing all the relevant pages (Perl script, anyone?).

I can see how to do this easily enough, I just don't know much PHP.

User avatar
AbsoluteDestiny
Joined: Wed Aug 15, 2001 1:56 pm
Location: Oxford, UK
Contact:
Org Profile

Post by AbsoluteDestiny » Thu Jun 03, 2004 6:04 pm

Well, this error should never happen... it only happened because I fucked with the php tables :)

So don't worry about it :)

User avatar
Kalium
Sir Bugsalot
Joined: Fri Oct 03, 2003 11:17 pm
Location: Plymouth, Michigan
Org Profile

Post by Kalium » Thu Jun 03, 2004 6:08 pm

AbsoluteDestiny wrote:Well, this error should never happen... it only happened because I fucked with the php tables :)

So don't worry about it :)
Errors are rarely supposed to happen (except in poorly designed programs, and I've written a few of those). They do, though, and it's usually a good idea to have something in place just in case.

User avatar
derobert
Phantom of the .Org
Joined: Wed Oct 24, 2001 8:35 am
Location: Sterling, Virginia
Contact:
Org Profile

Re: Perhaps some exception handling is in order?

Post by derobert » Sun Jun 06, 2004 7:13 am

Kalium wrote: Now, I can't see any reason why this would be difficult (I'm assuming PHP has error handling, which I'm pretty sure it does).
ROTFLMAO.
The only difficulty would lie in testing it and and changing all the relevant pages (Perl script, anyone?).
Some day, we'll clean up the huge mess... But no perl script (written in less time than doing the changes by hand) is going to manage to add error handling.
Key 55EA59FE; fingerprint = E501 CEE3 E030 2D48 D449 274C FB3F 88C2 55EA 59FE
A mighty order of ages is born anew.              http://twitter.com/derobert

User avatar
Kalium
Sir Bugsalot
Joined: Fri Oct 03, 2003 11:17 pm
Location: Plymouth, Michigan
Org Profile

Post by Kalium » Sun Jun 06, 2004 11:18 am

Making all the changes by hand...

Lessee... Taking into account the number of pages where an error could concievably occur (all of them), the current number of pages, and both the first and second derivatives of the growth equation.....

Doing it all by hand would take about....

Shit. I overflowed a double type. Calculating in weeks, too.

User avatar
derobert
Phantom of the .Org
Joined: Wed Oct 24, 2001 8:35 am
Location: Sterling, Virginia
Contact:
Org Profile

Post by derobert » Sun Jun 06, 2004 4:20 pm

Kalium wrote:Shit. I overflowed a double type. Calculating in weeks, too.
You overflowed double? Most intereting; doubles can't overflow (only go to ±∞), so please fix the bugs in your head. Not to mention that they have an absurd range before doing that, so double-check your math too. :twisted:

But, anyway, now how long would it take to write an AI that could do that? Yeah. (Answers without code presented will not be accepted.)
Key 55EA59FE; fingerprint = E501 CEE3 E030 2D48 D449 274C FB3F 88C2 55EA 59FE
A mighty order of ages is born anew.              http://twitter.com/derobert

User avatar
Kalium
Sir Bugsalot
Joined: Fri Oct 03, 2003 11:17 pm
Location: Plymouth, Michigan
Org Profile

Post by Kalium » Sun Jun 06, 2004 4:32 pm

OK, so my mental compiler has a few bugs. As for the math, there was a reason to incorporate the growth, projected at positive first and second derivatives for the forseeable future.

while(true_AI_does_not_exist) {
wait();
}

Locked

Return to “Site Help & Feedback”