Project

General

Profile

« Previous | Next » 

Revision 7126

generalize the exception handling because our actions are the same no matter what the specific error is during create - we just notify the CN that the replicate call failed

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
531 531
                result = (retPid.getValue().equals(pid.getValue()));
532 532
            }
533 533
            
534
        } catch (InvalidToken e) {
535
            String msg = "Could not save object to local store (InvalidToken): " + e.getMessage();
536
            failure = new ServiceFailure("2151", msg);
537
            setReplicationStatus(thisNodeSession, pid, nodeId, ReplicationStatus.FAILED, failure);
538
            logMetacat.error(msg);
539
            throw new ServiceFailure("2151", msg);
540
        
541
        } catch (IdentifierNotUnique e) {
542
            String msg = "Could not save object to local store (IdentifierNotUnique): " + e.getMessage();
543
            failure = new ServiceFailure("2151", msg);
544
            setReplicationStatus(thisNodeSession, pid, nodeId, ReplicationStatus.FAILED, failure);
545
            logMetacat.error(msg);
546
            throw new ServiceFailure("2151", msg);
547
        
548
        } catch (InvalidSystemMetadata e) {
549
            String msg = "Could not save object to local store (InvalidSystemMetadata): " + e.getMessage();
550
            failure = new ServiceFailure("2151", msg);
551
            setReplicationStatus(thisNodeSession, pid, nodeId, ReplicationStatus.FAILED, failure);
552
            logMetacat.error(msg);
553
            throw new ServiceFailure("2151", msg);
554
            
555 534
        } catch (Exception e) {
556
            String msg = "Could not save object to local store (Exception): " + e.getMessage();
535
            String msg = "Could not save object to local store (" + e.getClass().getName() + "): " + e.getMessage();
557 536
            failure = new ServiceFailure("2151", msg);
558 537
            setReplicationStatus(thisNodeSession, pid, nodeId, ReplicationStatus.FAILED, failure);
559 538
            logMetacat.error(msg);

Also available in: Unified diff