ensure more informative errors from `dmg.rb`

The logic for better errors was already there; this just makes
sure that another exceptional case is handled, and falls through
to the existing error-check.

References: #4857
Merge pull request #4887 from rolandwalker/better_dmg_errors

ensure more informative errors from `dmg.rb`