Ticket #11404 (new)

Opened 6 years ago

Last modified 5 years ago

Validator Error Messages

Reported by: Owen Arnold Owned by: Martyn Gigg
Priority: major Milestone: Backlog
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester:

Description (last modified by Owen Arnold) (diff)

  auto widthVectorValidator = boost::make_shared<CompositeValidator>();
  widthVectorValidator->add(boost::make_shared<ArrayBoundedValidator<int> >(0, 100));
  widthVectorValidator->add(boost::make_shared<MandatoryValidator<int > >()); // incorrect
  // widthVectorValidator->add(boost::make_shared<MandatoryValidator<std::vector<int> > >()); // correct

  declareProperty(new ArrayProperty<int>(
      "WidthVector", widthVectorValidator
      , Direction::Input), "Width vector. Either specify the width in n-pixels for each dimension, or provide a single entry (n-pixels) for all dimensions." );

now do

Algorithm alg;
alg.setChild(true);
alg.initialize();
std::vector<int> widthVector(1, 1);
alg.setProperty("WidthVector", widthVector); // Crashes out 

This last line crashes out with "Value was not of expected type." from TypedValidator, but the error was with the declaration of the MandatoryValidator. Would be better if the isValid message reflected that.

Change History

comment:1 Changed 6 years ago by Owen Arnold

  • Description modified (diff)

comment:2 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 12243

Note: See TracTickets for help on using tickets.