Project

General

Profile

1
package eu.dnetlib.repo.manager.service.shared;
2

    
3
import com.google.gwt.user.client.rpc.IsSerializable;
4

    
5
/**
6
 * Created by nikonas on 7/12/15.
7
 */
8
public class RepositoryServiceException extends Exception implements IsSerializable {
9

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

    
23
    private ErrorCode errorCode = null;
24

    
25
    public RepositoryServiceException() {
26
    }
27

    
28
    public RepositoryServiceException(ErrorCode errorCode) {
29
        this.errorCode = errorCode;
30
    }
31

    
32
    public RepositoryServiceException(String message, Throwable cause, ErrorCode errorCode) {
33
        super(message, cause);
34

    
35
        this.errorCode = errorCode;
36
    }
37

    
38
    public RepositoryServiceException(String message, ErrorCode errorCode) {
39
        super(message);
40

    
41
        this.errorCode = errorCode;
42
    }
43

    
44
    public RepositoryServiceException(Throwable cause, ErrorCode errorCode) {
45
        super(cause);
46

    
47
        this.errorCode = errorCode;
48
    }
49

    
50
    public ErrorCode getErrorCode() {
51
        return errorCode;
52
    }
53
}
(12-12/20)