|
@@ -23,6 +23,9 @@ import org.springframework.web.bind.annotation.ResponseStatus;
|
23
|
23
|
import javax.servlet.http.HttpServletRequest;
|
24
|
24
|
import javax.servlet.http.HttpServletResponse;
|
25
|
25
|
|
|
26
|
+import java.io.PrintWriter;
|
|
27
|
+import java.io.StringWriter;
|
|
28
|
+import java.io.Writer;
|
26
|
29
|
import java.util.List;
|
27
|
30
|
import java.util.stream.Collectors;
|
28
|
31
|
|
|
@@ -35,6 +38,11 @@ public class ApiExceptionHandler {
|
35
|
38
|
protected ExceptionDTO handleException(HttpServletRequest request, DataAccessException e) {
|
36
|
39
|
log.error(e.getMessage());
|
37
|
40
|
//e.printStackTrace();
|
|
41
|
+ //에러 트레이스
|
|
42
|
+ Writer buffer = new StringWriter();
|
|
43
|
+ PrintWriter pw = new PrintWriter(buffer);
|
|
44
|
+ e.printStackTrace(pw);
|
|
45
|
+ log.error(buffer.toString());
|
38
|
46
|
|
39
|
47
|
return ExceptionDTO.builder()
|
40
|
48
|
.status(HttpStatus.INTERNAL_SERVER_ERROR.value())
|