Subject: | die after get_index_by_name |
Date: | Tue, 16 Oct 2012 10:46:55 +0400 |
To: | bug-rest-neo4p [...] rt.cpan.org |
From: | DOBRO Sergei <vertolet666 [...] yandex.ru> |
Hi,
But I noticed that if index does not exist, the program dies. Example:
use REST::Neo4p;
REST::Neo4p->connect('http://127.0.0.1:7474');
my $idx = REST::Neo4p->get_index_by_name('my_index','node');
print "test\n";
OUTPUT:
Index 'my_index' not found in db
and word "test" is not printed.
Is there a better way to check the index? If id does not exist I would rather play with something like "return 404" than "die".
I'd like to write something like this:
my $idx = REST::Neo4p->get_index_by_name('my_index','node');
if ( INDEX_NOT_FOUND_CONDITION) {
REST::Neo4p::Index->new('node', 'my_index');
}
The same issue also concerns other methods ( get_node_by_id, get_relationship_by_id, etc.... )
Thanks.