Fixed error reporting and catch the simple error

Change-Id: Icbefd424c64db0ed43891ff0cbf70e3fda4b593e