[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 05 Oct 2006 13:59:58 -0000


albertel		Thu Oct  5 09:59:58 2006 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
  Log:
  - improve the error screen when a resource can't be gotten
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.259 loncom/homework/lonhomework.pm:1.260
--- loncom/homework/lonhomework.pm:1.259	Mon Oct  2 16:44:31 2006
+++ loncom/homework/lonhomework.pm	Thu Oct  5 09:59:57 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.259 2006/10/02 20:44:31 albertel Exp $
+# $Id: lonhomework.pm,v 1.260 2006/10/05 13:59:57 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -885,9 +885,16 @@
 	my $problem=&Apache::lonnet::getfile($file);
 	my $result;
 	if ($problem eq -1) {
-	    my $filename=(split('/',$file))[-1];
-	    $result.="<b> ".&mt('Unable to find')." <i>$filename</i></b>";
 	    $problem='';
+	    my $filename=(split('/',$file))[-1];
+	    my $error =
+		"<b> ".&mt('Unable to find [_1]',
+			   ' <span class="LC_filename">'.$filename.'</span>')
+		."</b>";
+	    $result.=
+		&Apache::loncommon::simple_error_page($request,'Not available',
+						      $error);
+	    return;
 	}
 
 	my %mystyle;