improve the error reporting

Change-Id: I9a1deacea6499bc0b15e3d9d1a375af299ecf493