Throw on build error if in production mode