Add an error handler for lookups

Signed-off-by: Gawain Lynch <gawain.lynch@gmail.com>