Ministack: Free, open-source local AWS emulator - 60+ services, Terraform compatible, real databases. Free forever. MIT licensed.
Python awsaws-emulatoraws-localaws-sdkdevtoolsdockerdynamodbec2emulatorlambdalocalstacklocalstack-alternativeministackmock-awsopen-sourcepythons3sqsterraform
fix: add <Type> element to XML error responses for botocore compatibility (#31)
Foad Keshehe5dbd49c65b2
diff --git a/ministack/core/responses.py b/ministack/core/responses.pyindex b43be7df..f775c733 100644--- a/ministack/core/responses.py+++ b/ministack/core/responses.py@@ -56,6 +56,8 @@ def error_response_xml(code: str, message: str, status: int, namespace: str = "h"""AWS-style XML error response."""root = Element("ErrorResponse", xmlns=namespace)error = SubElement(root, "Error")+ t = SubElement(error, "Type")+ t.text = "Sender" if status < 500 else "Receiver"c = SubElement(error, "Code")c.text = codem = SubElement(error, "Message")diff --git a/ministack/services/sqs.py b/ministack/services/sqs.pyindex 1048c43c..2d032249 100644--- a/ministack/services/sqs.py+++ b/ministack/services/sqs.py@@ -805,10 +805,11 @@ def _xml_resp(status: int, root: str, inner: str) -> tuple:def _xml_err_resp(code: str, msg: str, status: int = 400) -> tuple:+ sender_type = "Sender" if status < 500 else "Receiver"body = (f'<?xml version="1.0" encoding="UTF-8"?>'f'<ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">'- f'<Error><Code>{_esc(code)}</Code><Message>{_esc(msg)}</Message></Error>'+ f'<Error><Type>{sender_type}</Type><Code>{_esc(code)}</Code><Message>{_esc(msg)}</Message></Error>'f'<RequestId>{new_uuid()}</RequestId>'f'</ErrorResponse>').encode("utf-8")