Mahadev konar edited comment on ZOOKEEPER-358 at 5/15/09 1:22 PM:

  We should still throw an exception with the openledger call. most of the open 
api calls that you would encounter would throw an exception saying not found 
rather than failing silently and returning a null. Its understandable that 
async api cannot throw exceptions and would just return return codes that would 
map to the exception thrown by the synchronous api.

      was (Author: mahadev):
  We should still throw an exception with the openledger call. The  
asynchronous api is no excuse to hide excpetions. THe idea is to have 
asycnrhonous calls return the same error codes as the exception that you throw. 
For an example, take a look at zookeeper client api in java. It has both the 
synchronous calls and aysnc calls. The sync calls throw an exception and the 
async calls call the callback function with a return code which maps to the 
exception thrown via sync calls.
> Throw exception when ledger does not exist
> ------------------------------------------
>                 Key: ZOOKEEPER-358
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-358
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bookkeeper
>    Affects Versions: 3.1.1
>            Reporter: Luca Telloli
>            Assignee: Flavio Paiva Junqueira
>            Priority: Minor
>         Attachments: ZOOKEEPER-358.patch
> Currently, openLedger() in the BookKeeper client returns null if the ledger 
> ID does not exist on ZK. Maybe it would be better to throw a specific 
> exception so it can be handled by the client side. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to