/[Frey]/branches/zimbardo/lib/Frey/Web.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /branches/zimbardo/lib/Frey/Web.pm

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

revision 671 by dpavlin, Tue Dec 2 01:31:32 2008 UTC revision 678 by dpavlin, Tue Dec 2 02:05:55 2008 UTC
# Line 228  sub page { Line 228  sub page {
228                  eval {                  eval {
229                          $body = $self->$run;                          $body = $self->$run;
230                  };                  };
231                  $body                  $body = $self->error( $@, '' ) if $@;
                         = $self->error( $@ )  
                         . $self->dropdown( self => $self )  
                         if $@;  
232          }          }
233          if ( $self->content_type !~ m{html} ) {          if ( $self->content_type !~ m{html} ) {
234                  warn "# return only $self body ", $self->content_type;                  warn "# return only $self body ", $self->content_type;
# Line 322  sub editor_links { Line 319  sub editor_links {
319    
320          # perl's backtrace          # perl's backtrace
321          $error =~ s{at\s+(\S+)\s+line\s+(\d+)}          $error =~ s{at\s+(\S+)\s+line\s+(\d+)}
322                  {at <a target="editor" href="/editor+$1+$2">$1</a> line $2}gsm;                  {at <a target="editor" href="/editor+$1+$2" title="vi $1 +$2">$1</a> line $2}gsm;
323    
324          # our backtrace          $error =~ s{(via (?:package)\s+"?)([\w:]+)("?)}
325          $error =~ s{(via (?:package) "?)([\w:]+)("?)}                  {$1<a target="$2" href="/$2" title="introspect $2">$2</a>$3}gsm
326                  {$1<a target="editor" href="/editor+$2+1">$2</a>$3}gsm;          || # or anything that looks like "Class::Name"
327            $error =~ s{"(\w+(?:::\w+)+)"}
328                    {"<a target="$1" href="/$1" title="introspect $1">$1</a>"}gsm;
329    
330          # method error messages          # method error messages
331  #       $error =~ s{(method ")(\w+)"}          # FIXME replace with link to Frey::Introspect data
332  #               {$1<a target="/Frey::Shell::Grep?pattern=$2">$2</a>"}gsm; # FIXME replace with link to Frey::Introspect data          $error =~ s{(method ")(\w+)(" via)}
333                    {$1<a target="$2" href="/Frey::Shell::Grep/as_markup?pattern=$2" title="grep $2">$2</a>$3}gsm;
334          # anything that looks like Class::Name=  
335          $error =~ s{(\w+(?:::\w+)+)=}          # link paths to editor
336                  {<a target="$1" href="/$1">$1</a>=}gsm;          $error =~ s{(lib/[\w/]+\.pm)(\s+(\d+)\s+bytes)}
337                    {<a target="editor" href="/editor+$1+1" title="vi $1">$1</a>}gsm;
338    
339          return $error;          return $error;
340  }  }
# Line 633  sub backtrace { Line 633  sub backtrace {
633                  ) = caller($_) or last;                  ) = caller($_) or last;
634    
635                  push @backtrace,                  push @backtrace,
636                          qq|via $package at $path line $line|;                          qq|via "$package" at $path line $line|;
637          }          }
638          #warn "# backtrace: ", dump( @backtrace ) if @backtrace;          #warn "# backtrace: ", dump( @backtrace ) if @backtrace;
639          return @backtrace;          return @backtrace;

Legend:
Removed from v.671  
changed lines
  Added in v.678

  ViewVC Help
Powered by ViewVC 1.1.26