137 def fail(self, measRecord, error=None):
138 """Record a failure of the `measure` or `measureN` method.
142 measRecord : `lsst.afw.table.SourceRecord`
143 Table record describing the source being measured.
144 error : `MeasurementError`, optional
145 Only provided if the measurement failed due to a
146 `MeasurementError` being raised; otherwise, will be `None`.
150 When the plugin raises an exception, framework will call
151 `BasePlugin.fail` to allow the plugin to set its failure flag
152 field(s). When `BasePlugin.measureN` raises an exception,
153 `BasePlugin.fail` will be called repeatedly with all the records that
156 If the exception is an `MeasurementError`, it will be passed as the
157 error argument; in all other cases the error argument will be `None`,
158 and the failure will be logged by the measurement framework as a
162 traceback.print_exc()
163 message = (
"The algorithm '%s' thinks it cannot fail, but it did; "
164 "please report this as a bug (the full traceback is above)."
165 % (self.__class__.__name__,))