fix: ensure experiments return nil when we want to submit (#654)
Since https://github.com/ooni/probe-cli/pull/527, if an experiment returns an error, the corresponding measurement is not submitted since the semantics of returning an error is that something fundamental went wrong (e.g., we could not parse the input URL). This diff ensures that all experiments only return and error when something fundamental was wrong and return nil otherwise. Reference issue: https://github.com/ooni/probe/issues/1808.
This commit is contained in:
@@ -73,6 +73,10 @@ func (m Measurer) Run(
|
||||
<-ctx.Done()
|
||||
sess.Logger().Infof("%s", "Knock, knock, Neo.")
|
||||
callbacks.OnProgress(1.0, m.config.Message)
|
||||
// Note: if here we return an error, the parent code will assume
|
||||
// something fundamental was wrong and we don't have a measurement
|
||||
// to submit to the OONI collector. Keep this in mind when you
|
||||
// are writing new experiments!
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user