adobe / aem-core-cif-components

A set of configurations and components to get you started with AEM Commerce development
Apache License 2.0
102 stars 80 forks source link

MagentoGraphqlClient logs long stacktraces on error #1010

Open MatPiw opened 2 months ago

MatPiw commented 2 months ago

Expected Behaviour

When GraphQL query results in an error, as a developer I am able to handle and log the error according to my needs.

Actual Behaviour

When GraphQL query results in an error, the stack trace is always logged, before I am able to handle it. The stacktraces can be very long. This makes finding actual issues harder and log file increases in size dramatically.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

  1. Set up commerce endpoint on AEM
  2. Make the request that ends up in error (e.g. 500) via MagentoGraphqlClient
  3. Observe the logs

Platform and Version

Sample Code that illustrates the problem

https://github.com/adobe/aem-core-cif-components/blob/master/bundles/core/src/main/java/com/adobe/cq/commerce/core/components/internal/client/MagentoGraphqlClientImpl.java#L281

Logs taken while reproducing problem