Project

General

Profile

« Previous | Next » 

Revision 6656

include exception cause when throwing new exception (combine RuntimeException in Exception handling -- they are almst identical)

View differences:

src/edu/ucsb/nceas/metacat/dataone/CNodeService.java
869 869
      
870 870
      HazelcastService.getInstance().getSystemMetadataMap().unlock(pid);
871 871

  
872
    } catch(RuntimeException e) {
873
        // Catch Hazelcast RuntimeExceptions
874
        throw new ServiceFailure("4872", 
875
            "RuntimeException: Couldn't determine if node is allowed: " + 
876
            e.getStackTrace().toString());
877
      
878 872
    } catch(Exception e) {
879
        throw new ServiceFailure("4872", 
880
                "General Exception: Couldn't determine if node is allowed: " + 
881
                e.getStackTrace().toString());
873
    	ServiceFailure sf = new ServiceFailure("4872", 
874
                "Couldn't determine if node is allowed: " + 
875
                e.getMessage());
876
    	sf.initCause(e);
877
        throw sf;
882 878
        
883 879
    } finally {
884 880
      // always unlock the pid

Also available in: Unified diff