You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Mahadev konar (JIRA)" <ji...@apache.org> on 2009/05/15 22:23:45 UTC

[jira] Issue Comment Edited: (ZOOKEEPER-358) Throw exception when ledger does not exist

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12709910#action_12709910 ] 

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

flavio,
  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):
    flavio,
  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.