Help for this page

Select Code to Download


  1. or download this
    # Previous (manual OO) code:
    sub error_mode {                                                      
    +          
        my ($s, $mode) = @_;                                              
    +          
    ...
                                                                          
    +          
        $s->{error_mode};                                                 
    +          
    }
    
  2. or download this
    # Converted to Mouse:
    enum 'ErrorMode' => qw<carp error both>;
    has 'error_mode' => ( is => 'rw', isa => 'ErrorMode', default => 'erro
    +r' );
    
  3. or download this
    Attribute (error_mode) does not pass the type constraint because: Vali
    +dation failed for 'ErrorMode' with value  at /usr/local/lib/x86_64-li
    +nux-gnu/perl/5.26.1/Mouse/Util.pm line 395.
            Mouse::Util::throw_error(Mouse::Meta::Attribute=HASH(0x56165c0
    +b5528), "Attribute (error_mode) does not pass the type constraint bec
    +a"..., "data", "", "depth", -1) called at ./t/05-errors.t line 16