Changeset 3779


Ignore:
Timestamp:
Sep 25, 2007, 12:17:41 PM (15 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #776: ParameterType?.validate should include parameter name in error messages

Location:
branches/2.4-stable/src/core/net/sf/basedb/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4-stable/src/core/net/sf/basedb/core/ParameterType.java

    r3679 r3779  
    218218      if (!items.contains(value))
    219219      {
    220         throw new InvalidDataException("The value '" + value + "' isn't in the list of allowed values.");
     220        throw new InvalidDataException("The value '" + value + "' isn't in the list of allowed values for parameter '" + name + "'.");
    221221      }
    222222    }
  • branches/2.4-stable/src/core/net/sf/basedb/core/PathParameterType.java

    r3675 r3779  
    8787    Checks if the value is a valif {@link Path} value.
    8888    @param value The value to test
    89     @throws InvalidDataException If the value is not a string or too long
     89    @throws InvalidDataException If the value is not a valid path
    9090  */
    9191  void validateValue(String name, String value)
    9292    throws InvalidDataException
    9393  {
    94     new Path(value, pathType);
     94    try
     95    {
     96      new Path(value, pathType);
     97    }
     98    catch (InvalidPathException ex)
     99    {
     100      throw new InvalidPathException("Path for parameter '"+ name + "' is invalid: " + ex.getMessage());
     101    }
    95102  }
    96103  /**
Note: See TracChangeset for help on using the changeset viewer.