Changeset 55

Show
Ignore:
Timestamp:
04/04/06 10:50:24 (3 years ago)
Author:
schst
Message:

Transport more information in the exception (patch by Michael Hartmeier)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/java/net/schst/XJConf/TagDefinition.java

    r42 r55  
    11package net.schst.XJConf; 
    22 
     3import java.lang.reflect.InvocationTargetException; 
    34import java.lang.reflect.Method; 
    45import java.util.ArrayList; 
     
    263264                 
    264265                me.invoke(instance, meParams); 
    265             } catch (Exception e) { 
     266            } catch (InvocationTargetException e) { 
     267                if (e.getTargetException() instanceof Exception) { 
     268                    throw new ValueConversionException("Could not set attribute '" + att.getName() + "' of '" + this.type + "'.", (Exception) e.getTargetException()); 
     269                } else { 
     270                    throw new RuntimeException("Could not set attribute '" + att.getName() + "' of '" + this.type + "'.", e.getTargetException()); 
     271                } 
     272            }catch (Exception e) { 
    266273                throw new ValueConversionException("Could not set attribute '" + att.getName() + "' of '" + this.type + "'.", e); 
    267274            } 
    268275        } 
    269276    } 
    270      
     277 
    271278    /** 
    272279     * Add all children to the created instance