Fix deprecation warning, Errors#on have been deprecated