Revision 6860
Added by Chris Jones almost 13 years ago
src/edu/ucsb/nceas/metacat/restservice/D1ResourceHandler.java | ||
---|---|---|
55 | 55 |
import org.dataone.service.types.v1.ReplicationPolicy; |
56 | 56 |
import org.dataone.service.types.v1.Session; |
57 | 57 |
import org.dataone.service.types.v1.SystemMetadata; |
58 |
import org.dataone.service.util.ExceptionHandler; |
|
58 | 59 |
import org.dataone.service.util.TypeMarshaller; |
59 | 60 |
import org.jibx.runtime.JiBXException; |
60 | 61 |
import org.xml.sax.SAXException; |
... | ... | |
227 | 228 |
|
228 | 229 |
if ( exceptionFile != null ) { |
229 | 230 |
|
230 |
// deserialize the ReplicationPolicy
|
|
231 |
// deserialize the BaseException subclass
|
|
231 | 232 |
exceptionFileStream = new FileInputStream(exceptionFile); |
232 |
failure = TypeMarshaller.unmarshalTypeFromStream(BaseException.class, exceptionFileStream); |
|
233 |
try { |
|
234 |
failure = ExceptionHandler.deserializeXml(exceptionFileStream, |
|
235 |
"Replication failed for an unknown reason."); |
|
233 | 236 |
|
237 |
} catch (ParserConfigurationException e) { |
|
238 |
throw new ServiceFailure("4700", "Couldn't parse the replication failure exception: " + |
|
239 |
e.getMessage()); |
|
240 |
|
|
241 |
} catch (SAXException e) { |
|
242 |
throw new ServiceFailure("4700", "Couldn't traverse the replication failure exception: " + |
|
243 |
e.getMessage()); |
|
244 |
|
|
245 |
} |
|
246 |
|
|
234 | 247 |
} |
235 | 248 |
|
236 | 249 |
|
Also available in: Unified diff
Correctly deserialize the BaseException subclass in handling calls to setReplicationStatus()