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

See https://groups.google.com/d/msg/ol3-dev/fP15Q9D1vro/DXQKcukpqeYJ

Comments welcome