gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nishadi <...@git.apache.org>
Subject [GitHub] gora pull request #127: GORA-530 : Reinstated exception throwing in DataStor...
Date Tue, 13 Feb 2018 12:50:18 GMT
Github user nishadi commented on a diff in the pull request:

    https://github.com/apache/gora/pull/127#discussion_r167853773
  
    --- Diff: gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java
---
    @@ -159,17 +167,25 @@ public boolean schemaExists() {
        * @return the Object corresponding to the key or null if it cannot be found
        */
       @Override
    -  public T get(K key, String[] fields) {
    -
    -    Key recordKey = getAerospikeKey(key);
    -    fields = getFieldsToQuery(fields);
    +  public T get(K key, String[] fields) throws GoraException {
     
    -    Record record = aerospikeClient
    -            .get(aerospikeParameters.getAerospikeMapping().getReadPolicy(), recordKey,
fields);
    -    if (record == null) {
    -      return null;
    +    try {
    +      Key recordKey = getAerospikeKey(key);
    +      fields = getFieldsToQuery(fields);
    +  
    +      Record record = aerospikeClient
    +              .get(aerospikeParameters.getAerospikeMapping().getReadPolicy(), recordKey,
fields);
    +      
    +      if (record == null) {
    +        return null;
    +      }
    +      return createPersistentInstance(record, fields);
    +    } catch (GoraException e) {
    +      throw e;
    --- End diff --
    
    Hi,
    Is there any specific reason why we are capturing the GoraException separately?


---

Mime
View raw message