more errorhandling for getResourceFromUri