Bug 1026931 - factor the fallible initialization code, and capture and propagate errors.  r=shu