- return $self->model_class->authenticate($self) if
- $self->model_class->can("authenticate");
- return $self->authenticate($self); # Interface consistency is a Good Thing
+
+ # Check if we have a model class
+ if ( $self->{model_class} ) {
+ return $self->model_class->authenticate($self)
+ if $self->model_class->can("authenticate");
+ }
+ return $self->authenticate($self); # Interface consistency is a Good Thing
+}
+
+sub call_exception {
+ my $self = shift;
+ my ($error) = @_;
+
+ # Check if we have a model class
+ if ( $self->{model_class}
+ && $self->model_class->can('exception') )
+ {
+ my $status = $self->model_class->exception( $self, $error );
+ return $status if $status == OK;
+ }
+ return $self->exception($error);