mengw15 commented on code in PR #5164:
URL: https://github.com/apache/texera/pull/5164#discussion_r3293612907


##########
amber/src/main/scala/org/apache/texera/web/resource/GmailResource.scala:
##########
@@ -146,7 +147,11 @@ class GmailResource {
   @Path("/send")
   def sendEmailRequest(emailMessage: EmailMessage, @Auth user: SessionUser): 
Unit = {
     val recipientEmail = if (emailMessage.receiver.isEmpty) user.getEmail else 
emailMessage.receiver
-    sendEmail(emailMessage, recipientEmail)
+    sendEmail(emailMessage, recipientEmail) match {
+      case Right(_) => ()
+      case Left(error) =>
+        throw new WebApplicationException(error, Response.Status.BAD_GATEWAY)
+    }

Review Comment:
   Verified Jersey's WebApplicationException(message, Response.Status) ctor: it 
builds the response via Response.status(status).build() — no .entity() call, so 
the response body is empty in this Dropwizard configuration. The message only 
goes to exception.getMessage() for server-side logging (helpful for admin 
diagnosis); it does not appear in the HTTP response payload sent to the client. 
So no client-side leak in practice — keeping error as the exception message 
preserves the detail in the backend log.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to