Finish migration for type if failure.

Added catch/try blocks at bucket and batch levels, split try/catch for ins/upd into two try/catch blocks.