Better error messaging in maintenance scripts

Hopefully no more <<the operation failed with error: "1">>.  "1" isn't a
useful error message.  Nope.

Change-Id: I3c7d0eb67e33335f08472d8d8c0518ad9b9a009a
(cherry picked from commit 15b0043485d7ea217004ac0cc0d36abe30751fb4)