my $data = $self->__validate_added_data; if ( UNIVERSAL::isa( $data, 'Foo::Form' ) ) { # add the data } else { # process the error }