* Paul Makepeace <[EMAIL PROTECTED]> [2003-03-11 10:56]:
> On Tue, Mar 11, 2003 at 01:04:28AM +0000, Paul Makepeace wrote:
> > Hi, I've just started seeing the following errors in my logs,
> > 
> > [Mon Mar 10 08:27:59 2003] [error] Can't locate object method "type" via package 
> > "Template::Exception at /usr/share/perl/5.6.1/CGI/Carp.pm line 301.
> > " (perhaps you forgot to load "Template::Exception at 
> > /usr/share/perl/5.6.1/CGI/Carp.pm line 301.
> > "?) at [my Handler]
> 
> This error message is tricky. What's happened is that $template->error()
> is actually returning the string,

I've always operated under the assumption that $template->error will
return a string, since most of the time it is set with a string.  For
example, here is a random sampling of grep '>error([^)]' *.pm in
lib/Template:

  Config.pm:      || $class->error("failed to create constants namespace: ", 
  Config.pm:      || $class->error("failed to create context: ", $CONTEXT->error);
  Config.pm:      || $class->error("failed to create context: ", $SERVICE->error);
  Config.pm:      || $class->error("failed to create iterator: ", $ITERATOR->error);
  Config.pm:      || $class->error("failed to create stash: ", $STASH->error);
  Context.pm:    return $self->error("$name: filter not found")
  Parser.pm:      return $self->error("Invalid tag style: $tagstyle")
  Parser.pm:      || return $class->error($self->error());
  Parser.pm:    return $self->error("line $line: $msg");
  Parser.pm:    return $self->error('only 1 parser style remaining')
  Plugin.pm:    return $class->error("no context passed to $class constructor\n")
  Provider.pm:    return $self->error("INCLUDE_PATH exceeds $MAX_DIRS directories")

> Surely this is a bug?

Sure sounds like one, but I'm not sure where. ;)

> Presumably somewhere else a C<use Carp> has interfered with something
> and now I have to track down where and remove it? Any pointers or
> suggestions I'd really appreciate as this is making a whole raft of
> sites randomly fail.

If you can manage it, trigger the problem in the debugger and get a
stacktrace.

(darren)

-- 
The kind of thinking we do sets the stage for the action we are likely
to take. Because of this, a man who refuses to develop his thinking is
likely to act on the impressions made upon him by others.
    -- Dr.  Claude R. Baker

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to