Project

General

Profile

« Previous | Next » 

Revision 6506

check for null session before logging sync failed
https://redmine.dataone.org/issues/1798

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
851 851
        logMetacat.debug("Synchronization for the object identified by " + syncFailed.getPid() + " failed from " + syncFailed.getNodeId()
852 852
                + " Logging the event to the Metacat EventLog as a 'syncFailed' event.");
853 853
        // TODO: use the event type enum when the SYNCHRONIZATION_FAILED event is added
854
        EventLog.getInstance().log(syncFailed.getNodeId(), session.getSubject().getValue(), localId, "synchronization_failed");
854
        String principal = Constants.PUBLIC_SUBJECT;
855
        if (session != null && session.getSubject() != null) {
856
        	principal = session.getSubject().getValue();
857
        }
858
        try {
859
        	EventLog.getInstance().log(syncFailed.getNodeId(), principal, localId, "synchronization_failed");
860
        } catch (Exception e) {
861
            throw new ServiceFailure("2161", "Could not log the error for: " + syncFailed.getPid());
862
		}
855 863
        //EventLog.getInstance().log("CN URL WILL GO HERE", 
856 864
        //  session.getSubject().getValue(), localId, Event.SYNCHRONIZATION_FAILED);
857 865

  

Also available in: Unified diff