Project

General

Profile

1
package eu.dnetlib.repo.manager.domain;
2

    
3
/**
4
 * Created by nikonas on 7/12/15.
5
 */
6
public class RepositoryServiceException extends Exception {
7

    
8
    public enum ErrorCode{
9
        REPOSITORY_ALREADY_EXISTS,
10
        SQL_ERROR,
11
        NOT_ACTIVATED,
12
        ACTIVATION_ERROR,
13
        LDAP_ERROR,
14
        MAIL_ALREADY_EXISTS,
15
        GENERAL_ERROR,
16
        ALREADY_ACTIVATED,
17
        INVALID_EMAIL_FORMAT,
18
        NO_REPOS_FOR_THIS_COUNTRY, REPOSITORY_NOT_EXISTS, INCORRECT_CAPTCHA
19
    }
20

    
21
    private ErrorCode errorCode = null;
22

    
23
    public RepositoryServiceException() {
24
    }
25

    
26
    public RepositoryServiceException(ErrorCode errorCode) {
27
        this.errorCode = errorCode;
28
    }
29

    
30
    public RepositoryServiceException(String message, Throwable cause, ErrorCode errorCode) {
31
        super(message, cause);
32

    
33
        this.errorCode = errorCode;
34
    }
35

    
36
    public RepositoryServiceException(String message, ErrorCode errorCode) {
37
        super(message);
38

    
39
        this.errorCode = errorCode;
40
    }
41

    
42
    public RepositoryServiceException(Throwable cause, ErrorCode errorCode) {
43
        super(cause);
44

    
45
        this.errorCode = errorCode;
46
    }
47

    
48
    public ErrorCode getErrorCode() {
49
        return errorCode;
50
    }
51
}
(19-19/32)