In spider, you can just throw CloseSpider exception.
def parse_page(self, response):
if 'Bandwidth exceeded' in response.body:
raise CloseSpider('bandwidth_exceeded')
For others (middlewares, pipeline, etc), you can manually call close_spider as akhter mentioned.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…