Bug 17425: Add the Object::MethodNotCoveredByTests exception
[srvgit] / Koha / Object.pm
index cb2b9ef..b5e11af 100644 (file)
@@ -248,7 +248,7 @@ sub AUTOLOAD {
 
     my @known_methods = qw( is_changed id in_storage get_column );
 
-    carp "The method $method is not covered by tests or does not exist!" and return unless grep {/^$method$/} @known_methods;
+    Koha::Exceptions::Object::MethodNotCoveredByTests->throw( "The method $method is not covered by tests!" ) unless grep {/^$method$/} @known_methods;
 
     my $r = eval { $self->_result->$method(@_) };
     if ( $@ ) {