(#20920) Include file and line number on invalid resource relationship

Change the error type to ResourceError to make it include the file name
and line number.
(#20920) Test that missing resource deps add context

When calling the mixed in `#fail` method, an exception should be raised
that will add file and line information as part of the exception
message. This commit adds tests to ensure that when that context is
available it is part of the exception message.
Merge branch 'pull-1669'

This closes GH-1669