aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/submelon/pantry/ErrorResponse.java
diff options
context:
space:
mode:
authorKevin Hoerr <kjhoerr@noreply.cybr.es>2022-08-06 01:44:00 +0000
committerKevin Hoerr <kjhoerr@noreply.cybr.es>2022-08-06 01:44:00 +0000
commit461b1fa053bcc86d06156574ab59fa7000dbf69e (patch)
tree6e0080d057b5015bd92c843481cf45575af462a8 /src/main/java/dev/submelon/pantry/ErrorResponse.java
parentcdf65b32202746eaffd9e58bf951d1995ab03be3 (diff)
downloadpantry-461b1fa053bcc86d06156574ab59fa7000dbf69e.tar.gz
pantry-461b1fa053bcc86d06156574ab59fa7000dbf69e.tar.bz2
pantry-461b1fa053bcc86d06156574ab59fa7000dbf69e.zip
Quarkus (#2)
Reviewed-on: https://git.submelon.dev/kjhoerr/pantry/pulls/2
Diffstat (limited to 'src/main/java/dev/submelon/pantry/ErrorResponse.java')
-rw-r--r--src/main/java/dev/submelon/pantry/ErrorResponse.java58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/main/java/dev/submelon/pantry/ErrorResponse.java b/src/main/java/dev/submelon/pantry/ErrorResponse.java
deleted file mode 100644
index c5b1dbe..0000000
--- a/src/main/java/dev/submelon/pantry/ErrorResponse.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package dev.submelon.pantry;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.http.HttpStatus;
-import java.util.Date;
-
-@Getter
-@Setter
-public class ErrorResponse {
- // customizing timestamp serialization format
- @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy hh:mm:ss")
- private Date timestamp;
-
- private int code;
-
- private String status;
-
- private String message;
-
- private String stackTrace;
-
- private Object data;
-
- public ErrorResponse() {
- timestamp = new Date();
- }
-
- public ErrorResponse(HttpStatus httpStatus, String message) {
- this();
-
- this.code = httpStatus.value();
- this.status = httpStatus.name();
- this.message = message;
- }
-
- public ErrorResponse(
- HttpStatus httpStatus,
- String message,
- String stackTrace
- ) {
- this(httpStatus, message);
-
- this.stackTrace = stackTrace;
- }
-
- public ErrorResponse(
- HttpStatus httpStatus,
- String message,
- String stackTrace,
- Object data
- ) {
- this(httpStatus, message, stackTrace);
-
- this.data = data;
- }
-}