Project

General

Profile

« Previous | Next » 

Revision 5200

Added by daigle almost 15 years ago

Send appropriate message when trying to update a docid that was previously deleted.

View differences:

src/edu/ucsb/nceas/metacat/Eml210SAXHandler.java
420 420
								updateDate);
421 421
					}
422 422

  
423
				} catch (Exception ane) {
423
				} catch (McdbDocNotFoundException mdnfe) {
424
					Vector<Integer> revList = null;
425
					
426
					try {
427
						revList = DBUtil.getRevListFromRevisionTable(docid);
428
					} catch (SQLException sqle) {
429
						logMetacat.error("SQL error when trying to get rev list for doc " + docid + " : " + sqle.getMessage());
430
						throw (new SAXException("Doc ID " + docid + " was not found and cannot be updated.")); 
431
					}
432
					
433
					if (revList.size() > 0) {
434
						throw (new SAXException("Doc ID " + docid + " was deleted and cannot be updated."));
435
					} else {
436
						throw (new SAXException("Doc ID " + docid + " was not found and cannot be updated.")); 
437
					}
438
				} catch (Exception e) {
424 439
					throw (new SAXException("Error in EMLSaxHandler.startElement "
425
							+ action, ane));
440
							+ action, e));
426 441
				}
427 442
			}
428 443

  

Also available in: Unified diff