Replace 'throw new Error' by 'goog.asserts.fail'
Merge pull request #2584 from openlayers/error-by-fail

Replace 'throw new Error' by 'goog.asserts.fail'