Commit 9390b626 by Jan Hrabal

erorrs

parent 7f98b693
CREATE DATABASE suite
WITH
OWNER = postgres
ENCODING = 'utf8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
CREATE DATABASE suite
WITH
OWNER = postgres
ENCODING = 'utf8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
--
CREATE SEQUENCE ID_GENERATOR; CREATE SEQUENCE ID_GENERATOR;
-- version procedure -- version procedure
......
...@@ -19,6 +19,7 @@ public class ErrorMessage { ...@@ -19,6 +19,7 @@ public class ErrorMessage {
@JsonProperty("msg") @JsonProperty("msg")
private String message; private String message;
private Object payload;
/** /**
* Instantiates a new error message. * Instantiates a new error message.
...@@ -90,6 +91,44 @@ public class ErrorMessage { ...@@ -90,6 +91,44 @@ public class ErrorMessage {
return em; return em;
} }
public static ErrorMessage withCodePayload(String code, Object payload) {
ErrorMessage em = new ErrorMessage();
em.code = code;
em.payload = payload;
return em;
}
public static ErrorMessage withFieldCodePayload(String field, String code, Object payload) {
ErrorMessage em = new ErrorMessage();
em.field = field;
em.code = code;
em.payload = payload;
return em;
}
public static ErrorMessage withFieldCodeMessagePayload(String field, String code, String message, Object payload) {
ErrorMessage em = new ErrorMessage();
em.field = field;
em.code = code;
em.payload = payload;
em.message = message;
return em;
}
public static ErrorMessage withMessagePayload(String message, Object payload) {
ErrorMessage em = new ErrorMessage();
em.payload = payload;
em.message = message;
return em;
}
public static ErrorMessage withFieldMessagePayload(String field, String message, Object payload) {
ErrorMessage em = new ErrorMessage();
em.field = field;
em.payload = payload;
em.message = message;
return em;
}
/** /**
* With message. * With message.
...@@ -145,4 +184,8 @@ public class ErrorMessage { ...@@ -145,4 +184,8 @@ public class ErrorMessage {
public String getMessage() { public String getMessage() {
return message; return message;
} }
public Object getPayload() {
return payload;
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment