[staging_parse] Raise error if given invalid source

A string like 'foo:bar' is a valid URI but contains no path.
URI.parse('foo:bar') returns nil, and calling File.extname(nil) raises
"can't convert nil into String".

This commit ensures that the given URI has a valid path and fails early
if the input is malformed.