- universe.contents[element].set(facet, value)
- message = ("You have successfully (re)set the \"" + facet
- + "\" facet of element \"" + element
- + "\". Try \"show element " +
- element + "\" for verification.")
+ try:
+ universe.contents[element].set(facet, value)
+ except ValueError:
+ message = ("Value \"%s\" of type \"%s\" cannot be coerced "
+ "to the correct datatype for facet \"%s\"." %
+ (value, type(value), facet))
+ else:
+ message = ("You have successfully (re)set the \"" + facet
+ + "\" facet of element \"" + element
+ + "\". Try \"show element " +
+ element + "\" for verification.")