Project

General

Profile

« Previous | Next » 

Revision 6456

throw RuntimeExceptions when store() methods throw declared exceptions -- we want callers to put() to be alerted if there are errors.

View differences:

src/edu/ucsb/nceas/metacat/dataone/hazelcast/SystemMetadataMap.java
1 1
package edu.ucsb.nceas.metacat.dataone.hazelcast;
2 2

  
3
import java.sql.SQLException;
4 3
import java.util.Collection;
5 4
import java.util.HashMap;
6 5
import java.util.HashSet;
......
17 16

  
18 17
import edu.ucsb.nceas.metacat.IdentifierManager;
19 18
import edu.ucsb.nceas.metacat.McdbDocNotFoundException;
20
import edu.ucsb.nceas.metacat.shared.ServiceException;
21
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
22 19

  
23 20
/**
24 21
 * Storage implementation for Hazelcast System Metadata
......
47 44
				IdentifierManager.getInstance().updateSystemMetadata(sm);
48 45
			}
49 46
		} catch (McdbDocNotFoundException e) {
50
			// TODO Auto-generated catch block
51
			e.printStackTrace();
47
			throw new RuntimeException(e.getMessage(), e);
52 48
		}
53 49
	}
54 50

  
......
66 62
			System.out.println("loading from store: " + pid.getValue());
67 63
			sm = IdentifierManager.getInstance().getSystemMetadata(pid.getValue());
68 64
		} catch (McdbDocNotFoundException e) {
69
			// TODO Auto-generated catch block
70
			e.printStackTrace();
65
			throw new RuntimeException(e.getMessage(), e);
71 66
		}
72 67
		return sm;
73 68
	}
......
98 93
				Identifier pid = o.getIdentifier();
99 94
				pids.add(pid);
100 95
			}
101
		} catch (PropertyNotFoundException e) {
102
			// TODO Auto-generated catch block
103
			e.printStackTrace();
104
		} catch (ServiceException e) {
105
			// TODO Auto-generated catch block
106
			e.printStackTrace();
107
		} catch (SQLException e) {
108
			// TODO Auto-generated catch block
109
			e.printStackTrace();
96
		} catch (Exception e) {
97
			throw new RuntimeException(e.getMessage(), e);
110 98
		}
111 99
		
112 100
		return pids;

Also available in: Unified diff