This commit is contained in:
indx0
2025-11-21 21:05:27 +03:00
parent be8818b71f
commit a612c92833
14 changed files with 187 additions and 22 deletions

View File

@@ -0,0 +1,15 @@
package com.example.nto.exception.handler;
import com.example.nto.exception.CodeNotFoundException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
@ControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler(CodeNotFoundException.class)
public ResponseEntity<Void> handleCodeNotFoundException(CodeNotFoundException e) {
return new ResponseEntity<Void>(HttpStatus.UNAUTHORIZED);
}
}