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;
-- version procedure
......
......@@ -19,6 +19,7 @@ public class ErrorMessage {
@JsonProperty("msg")
private String message;
private Object payload;
/**
* Instantiates a new error message.
......@@ -89,8 +90,46 @@ public class ErrorMessage {
em.message = message;
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.
*
......@@ -145,4 +184,8 @@ public class ErrorMessage {
public String getMessage() {
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