Project

General

Profile

1 40251 nikon.gasp
package eu.dnetlib.repo.manager.shared;
2
3
import com.google.gwt.user.client.rpc.IsSerializable;
4
5
/**
6
 * Created by nikonas on 7/12/15.
7
 */
8 40336 nikon.gasp
public class RepositoryServiceException extends Exception implements IsSerializable {
9 40251 nikon.gasp
10
    public enum ErrorCode implements IsSerializable {
11 40336 nikon.gasp
        REPOSITORY_ALREADY_EXISTS,
12 40251 nikon.gasp
        SQL_ERROR,
13
        NOT_ACTIVATED,
14
        ACTIVATION_ERROR,
15
        LDAP_ERROR,
16 40336 nikon.gasp
        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 40251 nikon.gasp
    }
22
23
    private ErrorCode errorCode = null;
24
25 40336 nikon.gasp
    public RepositoryServiceException() {
26 40251 nikon.gasp
    }
27
28 40336 nikon.gasp
    public RepositoryServiceException(ErrorCode errorCode) {
29 40251 nikon.gasp
        this.errorCode = errorCode;
30
    }
31
32 40336 nikon.gasp
    public RepositoryServiceException(String message, Throwable cause, ErrorCode errorCode) {
33 40251 nikon.gasp
        super(message, cause);
34
35
        this.errorCode = errorCode;
36
    }
37
38 40336 nikon.gasp
    public RepositoryServiceException(String message, ErrorCode errorCode) {
39 40251 nikon.gasp
        super(message);
40
41
        this.errorCode = errorCode;
42
    }
43
44 40336 nikon.gasp
    public RepositoryServiceException(Throwable cause, ErrorCode errorCode) {
45 40251 nikon.gasp
        super(cause);
46
47
        this.errorCode = errorCode;
48
    }
49
50
    public ErrorCode getErrorCode() {
51
        return errorCode;
52
    }
53
}