puniverse / comsat

Fibers and actors for web development
docs.paralleluniverse.co/comsat
Other
598 stars 103 forks source link

HttpResponse.error missing body #80

Open safar opened 7 years ago

safar commented 7 years ago

I am using Netty together with Comsat's webactors.

Body string set with co.paralleluniverse.comsat.webactors.HttpResponse.error() method is never displayed.

I have following block of code:

if (succeeded) {
  msg.getFrom().send(HttpResponse.ok(self(), msg, "JSON parsed successfully")
      .setContentType("text/plain").build());
} else {
  System.out.println("RPC failed");
  msg.getFrom().send(HttpResponse.error(self(), msg, 500, "RPC failed")
      .setContentType("text/plain").build());
}

When it succeeds it will print out "JSON parsed successfully" in Response body, but if it fails it returns 500 Internal server error without body string that was set to "RPC failed".

Here is the output of Postman for both cases:

Can you please confirm if it is a bug or there is something else at hand here?

pron commented 7 years ago

Hi. The best way to get this addressed as quickly as possible is for you to troubleshoot the problem yourself by looking at the Comsat code and submit a PR. This seems like a very contained, local problem, that doesn't require deep understanding of Quasar or Comsat. Want to give it a try?