Revision 9023
Added by Jing Tao about 10 years ago
src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java | ||
---|---|---|
585 | 585 |
if (allowed) { |
586 | 586 |
try { |
587 | 587 |
inputStream = handler.read(localId); |
588 |
} catch (McdbDocNotFoundException de) { |
|
589 |
String error =""; |
|
590 |
if(EventLog.getInstance().isDeleted(localId)) { |
|
591 |
error=DELETEDMESSAGE; |
|
592 |
} |
|
593 |
throw new NotFound("1020", "The object specified by " + |
|
594 |
pid.getValue() + |
|
595 |
" does not exist at this node. "+error); |
|
588 | 596 |
} catch (Exception e) { |
589 |
String error =""; |
|
590 |
if(EventLog.getInstance().isDeleted(localId)) { |
|
591 |
error=DELETEDMESSAGE; |
|
592 |
} |
|
593 |
throw new NotFound("1020", "The object specified by " + |
|
597 |
throw new ServiceFailure("1030", "The object specified by " + |
|
594 | 598 |
pid.getValue() + |
595 |
"could not be returned due to error: " + |
|
596 |
e.getMessage()+". "+error);
|
|
599 |
" could not be returned due to error: " +
|
|
600 |
e.getMessage()+". "); |
|
597 | 601 |
} |
598 | 602 |
} |
599 | 603 |
|
600 | 604 |
// if we fail to set the input stream |
601 | 605 |
if ( inputStream == null ) { |
602 |
throw new NotFound("1020", "The object specified by " + |
|
606 |
String error =""; |
|
607 |
if(EventLog.getInstance().isDeleted(localId)) { |
|
608 |
error=DELETEDMESSAGE; |
|
609 |
} |
|
610 |
throw new NotFound("1020", "The object specified by " + |
|
603 | 611 |
pid.getValue() + |
604 |
"does not exist at this node.");
|
|
612 |
" does not exist at this node. "+error);
|
|
605 | 613 |
} |
606 | 614 |
|
607 | 615 |
// log the read event |
Also available in: Unified diff
Fixed a bug that some service failure exceptions were handled as the NotFound exception.