You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ha...@apache.org on 2002/09/12 00:12:30 UTC

cvs commit: jakarta-avalon/src/java/org/apache/avalon/framework/service ServiceException.java

hammant     2002/09/11 15:12:30

  Modified:    src/java/org/apache/avalon/framework/service
                        ServiceException.java
  Log:
  Better message for when lookup fails for reasons of role.
  
  Revision  Changes    Path
  1.9       +17 -0     jakarta-avalon/src/java/org/apache/avalon/framework/service/ServiceException.java
  
  Index: ServiceException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/service/ServiceException.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ServiceException.java	24 Aug 2002 14:18:17 -0000	1.8
  +++ ServiceException.java	11 Sep 2002 22:12:30 -0000	1.9
  @@ -18,6 +18,7 @@
    * @author <a href="mailto:fede@apache.org">Federico Barbieri</a>
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
    * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
  + * @author <a href="mailto:Paul_Hammant@yahoo.com">Paul Hammant</a>
    */
   public class ServiceException
       extends CascadingException
  @@ -75,5 +76,21 @@
       public String getRole()
       {
           return m_role;
  +    }
  +
  +    /**
  +     * Override super's message to add role if applicable.
  +     * @return a message.
  +     */
  +    public String getMessage()
  +    {
  +        if (m_role == null)
  +        {
  +            return super.getMessage();
  +        }
  +        else
  +        {
  +            return super.getMessage() + " (Role='" + m_role+ "')";
  +        }
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>