Changeset 15439


Ignore:
Timestamp:
2008-05-14T13:42:09+12:00 (14 years ago)
Author:
ak19
Message:

Exception output strings changed in method FedoraGS3RunException.getMessage()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/trunk/gs3-webservices-democlient/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Exception.java

    r15438 r15439  
    162162        }
    163163       
    164         /** Overloading getMessage() to return some details as to what
     164            /** Overloading getMessage() to return some details as to what
    165165         * exactly went wrong. */
    166166        public String getMessage() {
     
    170170            if(cause == null)
    171171                return super.getMessage();
    172 
     172           
    173173            if(cause instanceof RemoteException) {
    174174                // specifically indicate it's a RemoteException (as it encapsulates
     
    180180                // Some info on what caused the Remote Exception:
    181181                msg += ".\nCause: " + cause.getMessage();
    182             } else if(cause instanceof UnsupportedEncodingException) {
     182            } else { // Other kind of cause to exception:
     183                if(cause instanceof UnsupportedEncodingException) {
    183184                msg = "(UnsupportedEncodingException): trouble converting "
    184185                    + specifics + "returned "
    185186                    + "from Fedora web services to " + FedoraConnection.UTF8;
    186             } else if(cause instanceof SAXException) {
    187                 msg = "(SAXException): trouble parsing "
    188                 + specifics + " returned from web service";
    189             } else if(cause instanceof IOException) {
    190                 msg = "(IOException): trouble parsing "
    191                 + specifics + " returned from web service";
    192             }
    193             /*else if(cause instanceof TransformerException) {
    194                 msg = msg + "(TransformerException) - trouble converting original XML "
    195                 + "response into String";
    196             }*/
    197             // else (other Exception, including FedoraVersionNotSupportedException)
    198             // in those cases, just return it as it is.
    199            
    200             // else msg = "";
    201             if(!msg.equals(""))
    202                 msg = " " + msg + ". ";
    203            
     187                } else if(cause instanceof SAXException) {
     188                    msg = "(SAXException): trouble parsing "
     189                        + specifics + " returned from web service";
     190                } else if(cause instanceof IOException) {
     191                    msg = "(IOException): trouble parsing "
     192                        + specifics + " returned from web service";
     193                } /*else if(cause instanceof TransformerException) {
     194                    msg = msg + "(TransformerException) - trouble converting original XML "
     195                    + "response into String";
     196                }*/
     197                // else (other Exception, including FedoraVersionNotSupportedException)
     198                // in those cases, just return it as it is.
     199                // else msg = "";
     200                if(!msg.equals(""))
     201                    msg = " " + msg + ". ";
     202            }
    204203            return this.getClass().getCanonicalName()
    205204                + msg + super.getMessage();
Note: See TracChangeset for help on using the changeset viewer.