[fixes #391] exception when wrong resource type in URL

Fixes #391