Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove developer_message support #997

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions stripe/api_requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@ def handle_error_response(self, rbody, rcode, resp, rheaders):
raise err

def specific_api_error(self, rbody, rcode, resp, rheaders, error_data):
message = error_data.get("message") or error_data.get(
"developer_message"
)
message = error_data.get("message")

util.log_info(
"Stripe API error received",
Expand Down
7 changes: 0 additions & 7 deletions tests/test_api_requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,13 +734,6 @@ def test_extract_error_from_stream_request_for_response(
400,
)

def test_developer_message_in_error(self, requestor, mock_response):
mock_response('{"error": {"developer_message": "Unacceptable"}}', 400)

with pytest.raises(stripe.error.InvalidRequestError) as excinfo:
requestor.request("get", self.valid_path, {})
assert excinfo.value.user_message == "Unacceptable"

def test_raw_request_with_file_param(self, requestor, mock_response):
test_file = tempfile.NamedTemporaryFile()
test_file.write("\u263A".encode("utf-16"))
Expand Down