# # $Id: //depot/prod/test/main/lib/CR/Setup/Exceptions/ExpectationNotMetError.pm#1 $: # # Copyright (c) 2012 NetApp Inc. # All rights reserved. # ## @summary Provide an exception class that is a subclass of CR::Setup::Exception ## that provices exceptions for matchers not matching an expectation ## ## @author ciapponi@netapp.com ## @status private ## @pod here =pod =head1 Package Name NACL::Exceptions::ExpectationNotMetError.pm =head1 Author ciapponi@netapp.com =head1 Description Provides an exception for when expectations are not met when using matchers. =head1 See Also Package inherits from the Exception module in CR::Setup. =head1 NACL::Exceptions::ExpectationNotMetError =head2 Expected use Use when an expecation is not met when using a matcher. =head2 Usage Same as for exceptions defined by Exception.pm =head2 Base Class CR::Setup::Exception =cut package NACL::Exceptions::ExpectationNotMetError; use CR::Setup::Constants; use Params::Validate qw(:all); use base qw(NATE::BaseException); =head2 matcher_stacktrace Accessor for the matcher stacktracing contained within this exception, if any. =cut sub matcher_stacktrace { my $self = shift; my ($matcher_stacktrace) = validate_pos(@_, { type => ARRAYREF, optional => $TRUE }); if ( defined $matcher_stacktrace ) { $self->{'matcher_stacktrace'} = $matcher_stacktrace; return $self; # Provide chaining as an option } else { return $self->{'matcher_stacktrace'}; } } 1;