/[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 835 by dpavlin, Sun Dec 14 14:13:35 2008 UTC revision 837 by dpavlin, Sun Dec 14 15:13:55 2008 UTC
# Line 362  sub html_links { Line 362  sub html_links {
362          return $error;          return $error;
363  }  }
364    
365    sub html_self {
366            my $self = shift;
367            my $html = $self;
368            $html =~ s{([\w:]+)=}{<a target="$1" href="/$1" title="introspect $1">$1</a>=}gsm;
369            return $html;
370    }
371    
372  =head2 error  =head2 error
373    
374  This method will return error to browser and backtrace unless  This method will return error to browser and backtrace unless
# Line 374  sub error { Line 381  sub error {
381          my $error = join(" ", @_);          my $error = join(" ", @_);
382    
383          my $fatal = '';          my $fatal = '';
384            my $backtrace = '';
385    
386          if ( $error !~ m{\n$} ) {          if ( $error !~ m{\n$} ) {
387                  if ( my @backtrace = $self->backtrace ) {                  if ( my @backtrace = $self->backtrace ) {
388                          $error .= "\n\t" . join( "\n\t", @backtrace );                          $backtrace =
389                                      "\n" . $self->html_self . "->error backtrace\n\t"
390                                    . $self->html_links( join( "\n\t", @backtrace ) )
391                                    ;
392                          $fatal = qq| frey-fatal|;                          $fatal = qq| frey-fatal|;
393                  }                  }
394          }          }
395    
396          warn "ERROR: $error\n";          warn "ERROR: $error\n";
397          $self->add_icon('error');          $self->add_icon('error');
398          return          $error = $self->html_links( $error );
399                  qq|<pre class="frey-error$fatal">|          return qq|<pre class="frey-error$fatal">$error $backtrace</pre>| ;
                 . $self->html_links( $error ) .  
                 qq|</pre>|  
                 ;  
400  }  }
401    
402  =head1 Status line  =head1 Status line
# Line 667  sub backtrace { Line 675  sub backtrace {
675          my ($self) = @_;          my ($self) = @_;
676    
677          my @backtrace;          my @backtrace;
678          foreach ( 0 .. 5 ) {          foreach ( 1 .. 5 ) { # 0 = backtrace
679                  my (                  my (
680                          $package,$path,$line                          $package,$path,$line
681                          # subroutine hasargs                          # subroutine hasargs

Legend:
Removed from v.835  
changed lines
  Added in v.837

  ViewVC Help
Powered by ViewVC 1.1.26