View Javadoc

1   package pl.psnc.dl.ege.webapp.request;
2   
3   /**
4    * Created during performance of {@link ConversionRequestResolver}.<br/>
5    * <br/>
6    * Each instance has its own status - it is used to point out
7    * appropriate HTTP status when an error occurs.   
8    * 
9    *  @author mariuszs
10   */
11  public class RequestResolvingException extends Exception
12  {
13  	private final Status status;
14  	
15  	public static final String CONV_PARAMS = "Conversion properties expected on conversion request (POST method)!";
16  	
17  	public enum Status { 
18  		WRONG_METHOD,BAD_REQUEST, ERROR
19  	}
20  	
21  	public RequestResolvingException(String message){
22  		super(message);
23  		this.status = Status.ERROR;
24  	}
25  	
26  	public RequestResolvingException(RequestResolvingException.Status status){
27  		this.status = status;
28  	}
29  	
30  	public RequestResolvingException(RequestResolvingException.Status status, String message){
31  		super(message);
32  		this.status = status;
33  	}
34  	
35  	public Status getStatus(){
36  		return this.status;
37  	}
38  }