(#17842) Return meaningful errors with invalid resource references

Normally this kind of thing isn't allowed:

    file { '/tmp/foo':
      ensure => present,
      require => Mymodule::foo['bar'],
    }

However puppet lets it slip by when someone uses create resources:

    create_resources('file', { '/usr/local/homeaway/api-favorites-ustst1-jdk/java' => { ensure => present, require => "Mymodule::foo[bar]" }})

With the puppetdb terminus, our relationship checks fail when this kind of
delcaration is used, however in the compiler terminus it slips through because
I believe the comparison is done all in capitals.

Since the parser stops it, it shouldn't be allowed. However, our behaviour is
confusing to the user. This patch adds a more meaningful error message to this
kind of failure, instead of stating that it is a relationship error we stop
earlier with an error about the format.

Signed-off-by: Ken Barber <ken@bob.sh>
Raise Puppet::Error consistently in catalog indirector

Previously we were just raise exceptions with no specific exception, this patch
makes the behaviour consistent across the file. Tests updated also.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #442 from kbarber/ticket/master/17842-raise_correct_error_when_resourceref_invalid

(#17842) Return meaningful errors with invalid resource references