Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the RDF-Trine CPAN distribution.

Report information
The Basics
Id: 77278
Status: resolved
Priority: 0/
Queue: RDF-Trine

People
Owner: Nobody in particular
Requestors: perl [...] toby.ink
Cc:
AdminCc:

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



The constructors for RDF::Trine::Node::Resource and RDF::Trine::Node::Literal accept undef as a value, but then later calling certain methods on the node objects will issue loads of warnings about concatenating undefined values. The constructors should check whether they've been passed undef, and then either: 1. croak; or 2. use the empty string. I don't really care which. Croaking (or even better: confessing) would probably help a lot in tracking down errors.
On Fri May 18 10:14:26 2012, TOBYINK wrote: Show quoted text
> The constructors should check whether they've been passed undef, and then > either: > > 1. croak; or > 2. use the empty string. > > I don't really care which. Croaking (or even better: confessing) would > probably help a lot in tracking down errors.
Good catch. The way RDF::Trine generally deals with this is by throwing an exception. Would that be acceptable to you? thanks, .greg
Show quoted text
> Good catch. The way RDF::Trine generally deals with this is by > throwing an exception. Would that be acceptable to you?
Yes, that's fine. The important thing is to catch it in the constructor rather than later on when you try to serialize the data. -Toby
On Mon May 21 02:34:57 2012, TOBYINK wrote: Show quoted text
> Yes, that's fine. The important thing is to catch it in the constructor > rather than later on when you try to serialize the data.
Fixed in git commit 16e188d.