adaptErrors function

Never adaptErrors({
  1. required Object error,
  2. required StackTrace stackTrace,
})

method used to adapt the error from the platform interface

Implementation

Never adaptErrors({
  required Object error,
  required StackTrace stackTrace,
}) {
  if (error is PaymentCancelledByUserExceptionInterface) {
    throw PaymentCancelledByUserException();
  }
  Error.throwWithStackTrace(error, stackTrace);
}