Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.
This repository was archived by the owner on May 24, 2023. It is now read-only.

Re-factor ConcurrentModificationException re-wrapping #164

@andrii-kovalenko-ct

Description

@andrii-kovalenko-ct

Situation
PaymentMethodDispatcher itself throws io.sphere.sdk.client.ConcurrentModificationException

Complication
in PaymentDispatcher#dispatchPayment():

try {
    return methodDispatcher.dispatchPayment(paymentWithCartLike);
} catch (final ConcurrentModificationException cme) {
    throw new java.util.ConcurrentModificationException
        ("The payment could not be dispatched: " + cme.getMessage(), cme);
}

The thrown io.sphere.sdk.client.ConcurrentModificationException is wrapped to java.util.ConcurrentModificationException exception, which is unnecessary and make developer confusing.

Resolution

  • Avoid wrapping into java.util.ConcurrentModificationException
  • Fix the caller in PaymentHandler.java, which catches java.util.ConcurrentModificationException now.
  • Fix corresponding test cases if any.

Additional Information
#159 (comment)

After this #166 should be fixed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions