Bug 1385381 - Only call @checking callback if no error occurred; r?chmanchester
If an error was raised, there will be no return value. So it doesn't
make sense to call the formatting callback for ``None``. If we did
pass None, formatting callbacks would be more complex since they'd
need to handle that case.
MozReview-Commit-ID: GCppGDdbFiS
--- a/build/moz.configure/checks.configure
+++ b/build/moz.configure/checks.configure
@@ -48,17 +48,17 @@ def checking(what, callback=None):
def wrapped(*args, **kwargs):
log.info('checking %s... ', what)
with log.queue_debug():
error, ret = None, None
try:
ret = func(*args, **kwargs)
except FatalCheckError as e:
error = e.message
- display_ret = callback(ret) if callback else ret
+ display_ret = callback(ret) if callback and not error else ret
if display_ret is True:
log.info('yes')
elif display_ret is False or display_ret is None:
log.info('no')
else:
log.info(display_ret)
if error is not None:
die(error)