Adds error reporting to the code, but still non-functional search