Skip to content

Commit

Permalink
AD-282 Improve Error Handling and User Guidance for Payment Transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
pjaneta committed Jul 8, 2024
1 parent 53e6698 commit dda8ccf
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 dda8ccf

Please sign in to comment.