Add better error message consuming and dict processing

Change-Id: Iccdc69260318aabc9f8c79c8ea9efb84bdeea531