The new upgrade code tracks progress of upgrade and prevents further execution if error occurs. The problem is that when you rerun the upgrade after fixing the code the upgrade before the error is executed again - it could be solved by adding some fuction
upgrade_track_status($plugin, $version, $success)
if success true it would set $version in config table and return, if not it would print error message indicating exact version where the error occurred and return.
- prevented possible damage from running the same upgrade blocks second time
- user would only see the "real" even during second run of upgrade
- easier debugging when exact version number displayed with error