Revision 5283
Added by Matt Jones almost 15 years ago
src/edu/ucsb/nceas/metacat/client/rest/MetacatRestClient.java | ||
---|---|---|
378 | 378 |
try { |
379 | 379 |
response = sendData(resource, GET, urlParams, null, null, null, null); |
380 | 380 |
|
381 |
// Check for an error condition |
|
382 |
if (response.indexOf("<error>") != -1 ) { |
|
383 |
throw new MetacatException(response); |
|
384 |
} |
|
385 |
|
|
381 | 386 |
Reader responseReader = new StringReader(response); |
382 | 387 |
Node root = |
383 | 388 |
XMLUtilities.getXMLReaderAsDOMTreeRootNode(responseReader); |
... | ... | |
385 | 390 |
XMLUtilities.getNodeWithXPath(root, "/next-revision"); |
386 | 391 |
rev = Integer.parseInt(docidNode.getFirstChild().getNodeValue()); |
387 | 392 |
|
388 |
// Check for an error condition |
|
389 |
if (response.indexOf("<error>") != -1 ) { |
|
390 |
throw new MetacatException(response); |
|
391 |
} |
|
392 |
|
|
393 | 393 |
} catch (Exception e) { |
394 | 394 |
e.printStackTrace(); |
395 | 395 |
throw new MetacatException(e.getMessage()); |
Also available in: Unified diff
Fixed bug in getNextRevision() where "error" documents were not being
detected properly before searching for the next identifier.