Exemplo n.º 1
0
	def error(self, code, resource='', requestid='', hostid=''):
		self.set_header("Content-Type", "application/xml; charset=UTF-8")
		ae = AWSError(code)
		error = ({
			"Code": ae.getKey(),
			"Message": ae.getMessage(),
			"Resource": self.get_argument('Resource', default="?"),
			"RequestId": self.get_argument('RequestId', default="?"),
			"HostId": self.get_argument('HostId', default="?"),
		})
		self.set_status(ae.getCode())
		return self.render("templates/ErrorResponse.xml", error=error)
Exemplo n.º 2
0
		def response(status, reason, data):
			if status == 200:
				return True
			raise AWSError(status, reason, data)