Skip Menu |

This queue is for tickets about the HTTP-DAV CPAN distribution.

Report information
The Basics
Id: 68936
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: HTTP-DAV

People
Owner: cosimo [...] cpan.org
Requestors: alim [...] gmx.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.43
Fixed in: (no value)



Subject: bug in errors()
Currently this is the code of HTTP::DAV::errors: sub errors { @{ $_[0]->{_errors} } || () } This dies if _errors is empty with "cannot use undefined value as an array reference" because the alternative () comes too late, when the derefferencing was already attempted. It would work with this code instead: sub errors { @{ $_[0]->{_errors} || [] } } There is another related line in _start_multi_op: $_[0]->{_errors} = (); I think a better initiallisation would be: $_[0]->{_errors} = []; then, perhaps, errors() would not even need an alternative. I was hit by the above problem when I wanted to see what happens when a request fails, e.g. the DAV-Server is down. So I tried a connection to a server with no HTTP-Server running but was very surprised that this scenario did not raise any errors. I think errors() should return something ("Connection error" or whatever) in this case, at least a true value since there actually was an error. -Michael
Thanks Michael, should be fixed in 0.44, going out on CPAN as we speak. I added a specific test case. Let me know if you test it, thanks! -- Cosimo
From: alim [...] gmx.net
Show quoted text
> should be fixed in 0.44, going out on CPAN as we speak. > I added a specific test case. > Let me know if you test it, thanks!
Thanks for the fast response and fix! Looks good now. -Michael
Mark as resolved.