/*
 * Copyright (c) 2007, Stephen Colebourne & Michael Nascimento Santos
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *  * Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 *
 *  * Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 *  * Neither the name of JSR-310 nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package javax.time.calendar;

/**
 * An exception used when querying a calendar with a field that is not supported.
 *
 * @author Stephen Colebourne
 */
public class UnsupportedCalendarFieldException extends RuntimeException {

    /**
     * Constructs a new unsupported field exception with no message.
     */
    public UnsupportedCalendarFieldException() {
        super();
    }

    /**
     * Constructs a new unsupported field exception with the specified message.
     *
     * @param message  the message to use for this exception, may be null
     */
    public UnsupportedCalendarFieldException(String message) {
        super(message);
    }

    /**
     * Constructs a new unsupported field exception creating a standard error message.
     *
     * @param field  the field that is not supported, may be null
     * @param objectDescription  the description of the calendrical that does not support the field, not null
     */
    public UnsupportedCalendarFieldException(TimeFieldRule field, String objectDescription) {
        super("Field " + (field == null ? "null" : field.getName()) + " is not supported on a " + objectDescription);
    }

//    /**
//     * Constructs a new unsupported field exception with the specified message and cause.
//     *
//     * @param message  the message to use for this exception, may be null
//     * @param cause  the underlying cause of this exception, may be null
//     */
//    public UnsupportedCalendarFieldException(String message, Throwable cause) {
//        super(message, cause);
//    }
//
//    /**
//     * Constructs a new unsupported field exception with the specified cause,
//     * extracting the message from the cause if possible.
//     *
//     * @param cause  the underlying cause of this exception, may be null
//     */
//    public UnsupportedCalendarFieldException(Throwable cause) {
//        super(cause);
//    }

}

@@ -19,16 +19,21 @@
 c) 2007,
+2008,
  Stephen
@@ -1893,253 +1893,51 @@
   * 
-Constructs a new unsupported field exception with no message.%0D%0A     */%0D%0A    public UnsupportedCalendarFieldException() %7B%0D%0A        super();%0D%0A    %7D%0D%0A%0D%0A    /**%0D%0A     * Constructs a new unsupported field exception with the specified message.
+The field that caused the exception
 %0D%0A     *
 %0D%0A  
@@ -1936,188 +1936,53 @@
    *
+/
 %0D%0A    
- * @param message  the message to use for this exception, may be null%0D%0A     */%0D%0A    public UnsupportedCalendarFieldException(String message) %7B%0D%0A        super(message);%0D%0A    %7D
+private final TimeFieldRule fieldRule;
 %0D%0A%0D%0A
@@ -2105,17 +2105,33 @@
 am field
- 
+Rule  the rule of
  the fie
@@ -2270,19 +2270,22 @@
  field, 
-not
+may be
  null%0D%0A 
@@ -2356,16 +2356,20 @@
 le field
+Rule
 , String
@@ -2422,16 +2422,20 @@
 + (field
+Rule
  == null
@@ -2451,16 +2451,20 @@
  : field
+Rule
 .getName
@@ -2491,18 +2491,16 @@
 rted on 
-a 
 %22 + obje
@@ -2524,423 +2524,129 @@
     
-%7D%0D%0A%0D%0A//    /**%0D%0A//     * Constructs a new unsupported field exception with the specified message and cause.%0D%0A//     *%0D%0A//     * @param message  the message to use for this exception, may be null%0D%0A//     * @param cause  the underlying cause of this exception, may be null%0D%0A//     */%0D%0A//    public UnsupportedCalendarFieldException(String message, Throwable cause) %7B%0D%0A//        super(message, cause);%0D%0A//    %7D%0D%0A//%0D%0A//
+    this.fieldRule = fieldRule;%0D%0A    %7D%0D%0A%0D%0A    //-----------------------------------------------------------------------%0D%0A
     
@@ -2654,160 +2654,78 @@
 **%0D%0A
-//
      * 
-Constructs a new unsupported field exception with the specified cause,%0D%0A//     * extracting the message from the cause if possible
+Gets the rule of the field that caused the exception
 .%0D%0A
-//
      *%0D%0A
 //  
@@ -2724,18 +2724,16 @@
  *%0D%0A
-//
      * @
 para
@@ -2732,76 +2732,48 @@
  * @
-param cause  the underlying cause of this exception, may be null%0D%0A//
+return the field rule, null if unknown%0D%0A
     
@@ -2777,18 +2777,16 @@
     */%0D%0A
-//
     publ
@@ -2792,72 +2792,48 @@
 lic 
-UnsupportedCalendarFieldException(Throwable cause
+TimeFieldRule getFieldRule(
 ) %7B%0D%0A
-//
         
 supe
@@ -2832,25 +2832,27 @@
     
-super(cause)
+return fieldRule
 ;%0D%0A
-//
     

Store rule and provide access via a getter