Fix fatal error when using invalid target page title

Errors where not reported at all. So I fixed the bug by throwing
an exception on invalid target page title and inserted some error
reporting.

Bug: 50288
Change-Id: Ie7eeaba8d8c4c92daea8ae1a4945abfeeafdc7ab
Merge "Fix fatal error when using invalid target page title"