The imperative code has

    // log exception
which doesn't exist in the Result version.