Use the new function to properly handle error responses for all the commands. (cherry picked from commit 642f117d54)
642f117d54
(cherry picked from commit eb0939d967)
eb0939d967
(cherry picked from commit 9eafc60fa0)
9eafc60fa0