User: sits
Date: 08/06/30 22:59:51
Modified: lib/Codestriker/Http HighlightLineFilter.pm
Log:
Proper error handling if highlighting fails from mod_perl deployments.
Index: HighlightLineFilter.pm
===================================================================
RCS file:
/cvsroot/codestriker/codestriker/lib/Codestriker/Http/HighlightLineFilter.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- HighlightLineFilter.pm 20 Jun 2008 02:34:00 -0000 1.5
+++ HighlightLineFilter.pm 1 Jul 2008 05:59:50 -0000 1.6
@@ -50,7 +50,12 @@
push @args, '-f';
push @args, '-t';
push @args, $self->{tabwidth};
- Codestriker::execute_command($read_stdout_fh, undef, $self->{highlight},
@args);
+
+ # Wrap the command in an eval in case highlight fails running over the
file - for
+ # example if it is an unknown file type.
+ eval {
+ Codestriker::execute_command($read_stdout_fh, undef,
$self->{highlight}, @args);
+ };
if ($read_data eq "") {
# Assume this occurred because the filename was an unsupported type.
# Just return the text appropriately encoded for html output.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Codestriker-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/codestriker-commits