Initial error handling.

Signed-off-by: Thiago Farina <tfarina@chromium.org>