fix(rewrite): improve error message when needle not found error.

fixes #54