Bug: 43544: Improve error handling to not hide internal errors.

Change error handling to set the error flag when invoking certain functions
such as searchPart() and highlight(); the log files currently show errors
from these functions. There are a couple more such as getFuzzy() and
similar() that may need analogous changes but we currently do not see any
issues from these in the log files, so they are deferred till later.

Bug: 43544
Change-Id: Ibeef63f45a3276e870afbcadbd08c7bd2967b9e6