OauthInputException.php 766 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Oauth;
  7. use Magento\Framework\Exception\InputException;
  8. /**
  9. * @api
  10. * @since 100.0.2
  11. */
  12. class OauthInputException extends InputException
  13. {
  14. /**
  15. * Get error messages as a single comma separated string
  16. *
  17. * @return string
  18. */
  19. public function getAggregatedErrorMessage()
  20. {
  21. $errors = [];
  22. foreach ($this->getErrors() as $error) {
  23. // Clean up any trailing period
  24. $errors[] = rtrim($error->getMessage(), '.');
  25. }
  26. $errorMsg = '';
  27. if (!empty($errors)) {
  28. $errorMsg = implode(', ', $errors);
  29. }
  30. return $errorMsg;
  31. }
  32. }