(maint) Changing rescue of Exception to StandardError

Rescuing exception is in general a bad practice and can cause undesired behaviors.

A detailed discussion about this can be found here: https://github.com/puppetlabs/puppet/pull/1925#discussion_r6529813