Skip to content

Commit 6c199eb

Browse files
authored
Merge 0.3.1 to develop (#26)
2 parents a71cdd2 + 94f48b0 commit 6c199eb

7 files changed

Lines changed: 13 additions & 6 deletions

File tree

api-payload/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.namul</groupId>
88
<artifactId>beginner</artifactId>
9-
<version>0.3.0</version>
9+
<version>0.3.1</version>
1010
</parent>
1111

1212
<artifactId>api-payload</artifactId>

api-payload/src/main/java/org/namul/api/payload/code/DefaultResponseErrorCode.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public enum DefaultResponseErrorCode implements BaseErrorCode {
2626
@Override
2727
public DefaultResponseErrorReasonDTO getReason() {
2828
return DefaultResponseErrorReasonDTO.builder()
29+
.httpStatus(this.httpStatus)
2930
.message(this.message)
3031
.code(this.code)
3132
.isSuccess(false)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package org.namul.api.payload.code.dto;
22

3+
import org.springframework.http.HttpStatus;
4+
35
/**
46
* The interface that contains information about failures
57
*/
68
public interface ErrorReasonDTO {
9+
10+
HttpStatus getHttpStatus();
711
}

api-payload/src/main/java/org/namul/api/payload/error/ExceptionAdvice.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import lombok.RequiredArgsConstructor;
66
import org.namul.api.payload.code.dto.ErrorReasonDTO;
77
import org.namul.api.payload.error.configurer.ExceptionAdviceConfigurer;
8-
import org.namul.api.payload.handler.ExceptionAdviceHandler;
98
import org.namul.api.payload.response.BaseResponse;
109
import org.springframework.web.bind.annotation.ExceptionHandler;
1110
import org.springframework.web.bind.annotation.RestControllerAdvice;
@@ -43,6 +42,8 @@ public <E extends Exception> BaseResponse handle(E e, HttpServletRequest request
4342
* @param <E> The exception type
4443
*/
4544
private <E extends Exception> BaseResponse handleDelegated(E e, HttpServletRequest request, HttpServletResponse response, ExceptionAdviceRegistry<E, R> registry) {
46-
return registry.getHandler().handleException(e, request, response, registry.getErrorReasonDTO());
45+
R reasonDTO = registry.getErrorReasonDTO();
46+
response.setStatus(reasonDTO.getHttpStatus().value());
47+
return registry.getHandler().handleException(e, request, response, reasonDTO);
4748
}
4849
}

api-payload/src/main/java/org/namul/api/payload/response/AbstractBaseResponse.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.namul.api.payload.response;
22

3-
import com.fasterxml.jackson.annotation.JsonInclude;
43
import com.fasterxml.jackson.annotation.JsonProperty;
54
import lombok.Getter;
65

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package org.namul.api.payload.response;
22

3+
import java.io.Serializable;
4+
35
/**
46
* The top-level response interface
57
*/
6-
public interface BaseResponse {
8+
public interface BaseResponse extends Serializable {
79
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>org.namul</groupId>
66
<artifactId>beginner</artifactId>
7-
<version>0.3.0</version>
7+
<version>0.3.1</version>
88
<packaging>pom</packaging>
99

1010
<description>

0 commit comments

Comments
 (0)