[jboss-cvs] jboss-seam/src/mail/org/jboss/seam/mail/ui ...

Peter Muir peter at bleepbleep.org.uk
Wed Oct 10 11:18:16 EDT 2007


  User: pmuir   
  Date: 07/10/10 11:18:16

  Modified:    src/mail/org/jboss/seam/mail/ui  UIAttachment.java
  Log:
  Nicer error message
  
  Revision  Changes    Path
  1.12      +16 -0     jboss-seam/src/mail/org/jboss/seam/mail/ui/UIAttachment.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: UIAttachment.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/mail/org/jboss/seam/mail/ui/UIAttachment.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- UIAttachment.java	4 Oct 2007 23:15:17 -0000	1.11
  +++ UIAttachment.java	10 Oct 2007 15:18:16 -0000	1.12
  @@ -144,6 +144,22 @@
            }
            if (ds != null)
            {
  +             // Check the DataSource is available
  +             try
  +             {
  +                 ds.getInputStream();
  +             }
  +             catch (Exception e) 
  +             {
  +                 if (value != null)
  +                 {
  +                     throw new NullPointerException("Error accessing " + value);
  +                 }
  +                 else
  +                 {
  +                     throw new NullPointerException("Error accessing " + getValueExpression("value").getExpressionString());
  +                 }
  +            }
               MimeBodyPart attachment = new MimeBodyPart();
               // Need to manually set the contentid
               String contentId = RandomStringUtils.randomAlphabetic(20).toLowerCase();
  
  
  



More information about the jboss-cvs-commits mailing list