# # Copyright (c) 2009-2011 NetApp Inc. # All rights reserved. # ## @summary Provide an exception class that is a subclass of ## NATE::BaseException that will be thrown when verification of one ## or more field values does not match the provided value. ## ## @author madhavs@netapp.com, dl-nacl-dev@netapp.com ## @status Shared ## @pod here =head1 NAME NACL::Exceptions::VerifyFailure =head1 DESCRIPTION This exception is thrown when verification of field values does not pass, i.e the field value for one or more fields does not match what was provided. =head1 ATTRIBUTES =head2 unexpected_values In addition to the attributes that exception objects generally contain, this exception also contains an C attribute. This is a hash-reference, with the keys denoting the fields whose values didn't match. The value of the key is the unexpected value of that field. =head1 EXAMPLE use NACL::Exceptions::VerifyFailure qw(:try); try { $aggr_obj->verify_state('block-type' => '64-bit', state => 'online'); } catch NACL::Exceptions::VerifyFailure with { my $exception = shift; $Log->comment("Unexpected fields and their values: " . $exception->text()); my $unexpected_values_hashref = $exception->unexpected_values(); }; =cut package NACL::Exceptions::VerifyFailure; use base qw(NATE::BaseException); use Class::MethodMaker [ scalar => 'unexpected_values', ]; 1;