Based on RFC7807, error response should not include the exception message or stack trace:
Problem details are not a debugging tool for the underlying implementation; rather, they are a way to expose greater detail about the HTTP interface itself. - RFC7807