Skip to content

Commit

Permalink
update :: record 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ta2ye0n committed Oct 11, 2024
1 parent e06e043 commit 292e005
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/main/java/com/gcms/v3/global/error/ErrorResponse.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package com.gcms.v3.global.error;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

@Getter
@Builder
@AllArgsConstructor
public class ErrorResponse {
private HttpStatus status;
private String message;

public record ErrorResponse(
HttpStatus status,
String message
) {
public static ResponseEntity<ErrorResponse> toResponseEntity(ErrorCode e){
return ResponseEntity
.status(e.getHttpStatus())
Expand Down

0 comments on commit 292e005

Please sign in to comment.