Skip to content

Commit

Permalink
Include email API error responses in HTTP response
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Apr 10, 2024
1 parent 36f6356 commit 909fd74
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 909fd74

Please sign in to comment.