Fixed on-error behaviour of resource creation

closes #365