Add support for return error code if any error found.