Skip to content

Commit

Permalink
Merge pull request #422 from Adyen/feature/AD-282
Browse files Browse the repository at this point in the history
AD-282 Improve Error Handling and User Guidance for Payment Transactions
  • Loading branch information
pjaneta authored Jul 18, 2024
2 parents 3012e28 + dda8ccf commit e86902f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
http://www.springframework.org/schema/context/spring-context.xsd">

<context:component-scan base-package="com.adyen.commerce.controllers"/>
<context:component-scan base-package="com.adyen.commerce.exceptionhandler"/>

</beans>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.adyen.commerce.exceptionhandler;

import com.adyen.commerce.exception.AdyenControllerException;
import com.adyen.commerce.response.ErrorResponse;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
Expand All @@ -9,7 +10,7 @@
public class AdyenOCCControllerExceptionHandler {

@ExceptionHandler(value = AdyenControllerException.class)
public ResponseEntity<Void> handleAdyenControllerException(AdyenControllerException exception) {
return ResponseEntity.badRequest().build();
public ResponseEntity<ErrorResponse> handleAdyenControllerException(AdyenControllerException exception) {
return ResponseEntity.badRequest().body(exception.getErrorResponse());
}
}

0 comments on commit e86902f

Please sign in to comment.