package me.shortify.sparkserver.exception;

import org.json.JSONObject;

public class Error {
	
	public static final String URL_EXISTS = "The custom text specified alredy exists in the database. Try with another one.";
	public static final String BAD_URL = "The URL specified refers to not safe web site. Try with another URL.";
	public static final String BAD_CUSTOM_URL = "The custom text specified is not accepted.";
	public static final String SHORT_URL_NOT_EXISTS = "The short URL specified does not exist";
	public static final String URL_NOT_SPECIFIED = "You need to insert a short URL";
	
	private final String ERROR = "error";
	
	private String error;
	
	public Error(String error) {
		this.error = error;
	}
	
	public String toJsonString() {
		JSONObject jo = new JSONObject();	
		jo.put(ERROR, error);
		return jo.toString();
	}
	
}

@@ -161,16 +161,17 @@
 ied alre
+a
 dy exist
@@ -280,16 +280,18 @@
 fers to 
+a 
 not safe
@@ -294,17 +294,16 @@
 safe web
- 
 site. Tr
@@ -505,16 +505,17 @@
 ot exist
+.
 %22;%0A%09publ
@@ -588,16 +588,17 @@
 hort URL
+.
 %22;%0A%09%0A%09pr

Fix messaggio di errore