forked from osopromadze/Spring-Boot-Blog-REST-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnauthorizedException.java
More file actions
46 lines (33 loc) · 1006 Bytes
/
UnauthorizedException.java
File metadata and controls
46 lines (33 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.sopromadze.blogapi.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
import com.sopromadze.blogapi.payload.ApiResponse;
@ResponseStatus(code = HttpStatus.UNAUTHORIZED)
public class UnauthorizedException extends RuntimeException {
private static final long serialVersionUID = 1L;
private ApiResponse apiResponse;
private String message;
public UnauthorizedException(ApiResponse apiResponse) {
super();
this.apiResponse = apiResponse;
}
public UnauthorizedException(String message){
super(message);
this.message = message;
}
public UnauthorizedException(String message, Throwable cause){
super(message, cause);
}
public ApiResponse getApiResponse() {
return apiResponse;
}
public void setApiResponse(ApiResponse apiResponse) {
this.apiResponse = apiResponse;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}