Bug 1273668

Summary: to_string() appends 'undef' to array attribute
Product: [Fedora] Fedora EPEL Reporter: Jim Vella <jim>
Component: perl-Exception-BaseAssignee: Paul Howarth <paul>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: epel7CC: paul, perl-devel
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
URL: https://github.com/dex4er/perl-Exception-Base/issues/3
Whiteboard:
Fixed In Version: perl-Exception-Base-0.2501-1.el7 perl-Exception-Base-0.2501-23.fc39 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-07 06:16:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jim Vella 2015-10-21 00:08:11 UTC
Description of problem:
Invoking to_string has the side effect of appending 'undef' to an array attribute.

Version-Release number of selected component (if applicable):
perl-Exception-Base-0.2500-1.el7.noarch.rpm
perl v5.16.3

How reproducible:
Always

Steps to Reproduce:
Can reproduce with this perl script:

#!/bin/perl
use warnings;
use strict;

use Data::Dumper;

use Exception::Base
    'MyException', => {
        message => 'Validation error',
        has     => [ qw(class errors) ],

        string_attributes => [ 'message', 'class', 'errors' ]
    };
eval {
    MyException->throw(
            class  => __PACKAGE__,
            errors => ["error 1", "error 2", "error 3"]
        );
};

my $exception = $@;

print( Dumper($exception->errors()) . "\n");

$exception->to_string();

print( Dumper($exception->errors()) . "\n");


Actual results:
Can see an additional 'undef' in the array returned after invoking to_string();

Expected results:
The returned array should be the same as when thrown.


Additional info:

Comment 1 Fedora Update System 2016-08-22 10:43:42 UTC
perl-Exception-Base-0.2501-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-22753b2cc4

Comment 2 Fedora Update System 2016-08-22 19:48:16 UTC
perl-Exception-Base-0.2501-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-22753b2cc4

Comment 3 Fedora Update System 2016-09-07 06:16:47 UTC
perl-Exception-Base-0.2501-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Comment 4 Fedora Update System 2023-04-07 16:36:59 UTC
FEDORA-2023-ae45d14c82 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-ae45d14c82

Comment 5 Fedora Update System 2023-04-07 16:38:48 UTC
FEDORA-2023-ae45d14c82 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.