Upgrade wraper, added error handling

blueprint upgrade-to-5-1
Related-bug: #1333350
Change-Id: I56ff3b2b1a2f0d4c63787785640af531986eab75
Merge "Upgrade wraper, added error handling"