avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject cvs commit: jakarta-avalon/src/java/org/apache/avalon/framework/component ComponentException.java
Date Fri, 23 Aug 2002 02:44:43 GMT
leif        2002/08/22 19:44:43

  Modified:    src/java/org/apache/avalon/framework/component
                        ComponentException.java
  Log:
  Override the getMessage method so that the rolw will be displayed if available.
  
  Revision  Changes    Path
  1.10      +22 -0     jakarta-avalon/src/java/org/apache/avalon/framework/component/ComponentException.java
  
  Index: ComponentException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/component/ComponentException.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ComponentException.java	5 Aug 2002 13:23:56 -0000	1.9
  +++ ComponentException.java	23 Aug 2002 02:44:43 -0000	1.10
  @@ -69,8 +69,30 @@
           this( role, message, null );
       }
   
  +    /**
  +     * Get the role which let to the exception.  May be null.
  +     *
  +     * @return The role which let to the exception.
  +     */
       public final String getRole()
       {
           return m_role;
  +    }
  +    
  +    /**
  +     * Return a message describing the exception.
  +     *
  +     * @return exception message.
  +     */
  +    public String getMessage()
  +    {
  +        if ( m_role == null )
  +        {
  +            return super.getMessage();
  +        }
  +        else
  +        {
  +            return super.getMessage() + " (role [" + m_role + "])";
  +        }
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message