From 9ab975068e04db8f4c11f1034b7f8c15ab2a1443 Mon Sep 17 00:00:00 2001 From: Robin Edwards Date: Wed, 20 Apr 2011 14:52:42 +0100 Subject: storing without key only supported by REST - added notice for this --- lib/Net/Riak/Role/PBC/Object.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/Net/Riak/Role/PBC/Object.pm b/lib/Net/Riak/Role/PBC/Object.pm index 847cac2..f1a82a5 100644 --- a/lib/Net/Riak/Role/PBC/Object.pm +++ b/lib/Net/Riak/Role/PBC/Object.pm @@ -8,6 +8,8 @@ use List::Util 'first'; sub store_object { my ($self, $w, $dw, $object) = @_; + die "Storing object without a key is not supported in the PBC interface" unless $object->key; + my $value = (ref $object->data && $object->content_type eq 'application/json') ? JSON::encode_json($object->data) : $object->data; -- cgit 1.4.1