Fixes #361, ensure build errors are propagated through to optimize errback.
Merge pull request #367 from potif/upstream-issue-361

Fixes #361, ensure build errors are propagated through to optimize errback