Cancel build when throwing warning

Is there a possibility to cancel the build when there is a warning? We would like to exit a Jenkins build when the JavaScript is not minifying (see https://github.com/middleman/middleman/pull/376).