--- loncom/xml/run.pm 2003/06/18 21:04:42 1.39 +++ loncom/xml/run.pm 2003/10/01 21:27:35 1.40 @@ -1,6 +1,6 @@ package Apache::run; # -# $Id: run.pm,v 1.39 2003/06/18 21:04:42 albertel Exp $ +# $Id: run.pm,v 1.40 2003/10/01 21:27:35 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -98,10 +98,20 @@ sub run { $error = 'Code ran too long. It ran for more than '. Apache->request->server->timeout.' seconds'; } - &Apache::lonxml::error('
'.&HTML::Entities::encode($error).' '.
-			       &HTML::Entities::encode($innererror).
-			       '
occured while running
'.
-			       &HTML::Entities::encode($code).'
'); + my $errormsg='
'.&HTML::Entities::encode($error).' '.
+	    &HTML::Entities::encode($innererror).
+	    '
occured while running
';
+	$code=&HTML::Entities::encode($code);
+	&Apache::lonxml::debug("");
+	if ($innererror=~/line (\d+)/) {
+	    &Apache::lonxml::debug("Line is $1");
+	    my $linenumber=$1;
+	    my @code=split("\n",$code);
+	    $code[$linenumber-1]=''.
+		$code[$linenumber-1].'';
+	    $code=join("\n",@code);
+	}
+	&Apache::lonxml::error($errormsg.$code.'
'); } if ( $#result < '1') { return $result[0];