Skip to content

Error handling in python client [JIRA: CLIENTS-667] #112

Open
@seancribbs

Description

@seancribbs

Moved from https://issues.basho.com/show_bug.cgi?id=385, reported by Mehmet Ali Akmanalp

It looks like it's hard to handle or even notice errors with the python client. Here's a prime example:

import riak

c = riak.RiakClient("127.0.0.1", 8087, transport_class=riak.RiakPbcTransport)

b = c.bucket("")
o = b.new("")
o.set_data({"foo":1, "bar": 4})
o.store()

This runs silently. No exceptions are thrown. I don't know what it did. I can't check any of the return values because they mostly return "self". There seems to be a RiakError but that's a more generic "oh crap something went terribly wrong" whereas the sort of granularity people would want (IMHO) is "the database connection failed" (which throws a socket.error by the way) or "x does not exist".

Thanks,
~mali

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions