Changeset 1256


Ignore:
Timestamp:
Oct 2, 2011, 6:04:40 PM (13 years ago)
Author:
Solomon Blaz
Message:

added guard clauses to VistaLinkSessionDao in case initUser RPC fails

File:
1 edited

Legend:

Unmodified
Added
Removed
  • EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/rpc/VistaLinkSessionDao.java

    r1227 r1256  
    55import org.springframework.dao.DataAccessException;
    66import org.springframework.dao.DataRetrievalFailureException;
     7import org.springframework.util.StringUtils;
    78import org.w3c.dom.Document;
    89import org.w3c.dom.Element;
     
    5556
    5657    private Document buildDocument(String result) {
     58        if (!StringUtils.hasText(result)) throw new DataRetrievalFailureException("unable to get user info: EDPCTRL RPC(command=initUser) returned an empty response");
     59        if (result.contains("error")) throw new DataRetrievalFailureException("unable to get user info: EDPCTRL RPC(command=initUser) returned an error");
    5760        try {
    5861            DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Note: See TracChangeset for help on using the changeset viewer.