[Bio] / FigKernelPackages / ServerThing.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/ServerThing.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.29, Thu Dec 10 19:12:21 2009 UTC revision 1.30, Fri Dec 11 21:21:04 2009 UTC
# Line 351  Line 351 
351          } elsif (! $function) {          } elsif (! $function) {
352              SendError("No function specified.", "No function specified.");              SendError("No function specified.", "No function specified.");
353          } else {          } else {
354              $document = eval("\$serverThing->$function(\$args)");              $document = eval { $serverThing->$function($args) };
355              # If we have an error, create an error document.              # If we have an error, create an error document.
356              if ($@) {              if ($@) {
357                  SendError($@, "Error detected by service.");                  SendError($@, "Error detected by service.");
# Line 554  Line 554 
554      # Get the parameters.      # Get the parameters.
555      my ($message, $status) = @_;      my ($message, $status) = @_;
556      Trace("Error \"$status\" $message") if T(2);      Trace("Error \"$status\" $message") if T(2);
557        # Check for a DBserver error. These can be retried and get a special status
558        # code.
559        my $realStatus;
560        if ($message =~ /DBServer Error:\s+/) {
561            $realStatus = "503 $status";
562        } else {
563            $realStatus = "500 $status";
564        }
565      # Print the header and the status message.      # Print the header and the status message.
566      print CGI::header(-type => 'text/plain',      print CGI::header(-type => 'text/plain',
567                        -status => "500 $status");                        -status => $realStatus);
568      # Print the detailed message.      # Print the detailed message.
569      print $message;      print $message;
570  }  }

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3