Skip to content

Commit

Permalink
Include email API error responses in HTTP response (#19)
Browse files Browse the repository at this point in the history
# Description
Include response error messages in email error responses

# Issues
Response messages updated in
NeonGeckoCom/neon_email_proxy#28

# Other Notes
<!-- Note any breaking changes, WIP changes, requests for input, etc.
here -->

Co-authored-by: Daniel McKnight <[email protected]>
  • Loading branch information
NeonDaniel and NeonDaniel authored Apr 10, 2024
1 parent 36f6356 commit 100a1c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion neon_hana/mq_service_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def send_email(self, recipient: str, subject: str, body: str,
response = send_mq_request("/neon_emails", request_data,
"neon_emails_input")
if not response.get("success"):
raise APIError(status_code=500, detail="Email failed to send")
error = response.get("error") or "Email failed to send"
raise APIError(status_code=500, detail=error)

def upload_metric(self, metric_name: str, timestamp: str,
metric_data: Dict[str, Any]):
Expand Down

0 comments on commit 100a1c4

Please sign in to comment.