I had the same issue, the whole stack trace was being sent in the response, the culprit was my custom exception class which was extending Exception. Removing the extends fixed the issue.