1 /********************************************** 2 * Copyright (C) 2009 Lukas Laag 3 * This file is part of Vectomatic. 4 * 5 * Vectomatic is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * Vectomatic is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with Vectomatic. If not, see http://www.gnu.org/licenses/ 17 **********************************************/ 18 package org.vectomatic.common.rpc; 19 20 import com.google.gwt.user.client.rpc.IsSerializable; 21 22 public class AccountServiceException extends Exception implements IsSerializable { 23 private static final long serialVersionUID = 1L; 24 /** 25 * The user enters an incorrect captcha 26 */ 27 public static final int CAPTCHA = 1; 28 /** 29 * The requested account name is already user 30 */ 31 public static final int EXISTING_ACCOUNT = 2; 32 /** 33 * The account number quota has been exceeded 34 */ 35 public static final int OUT_OF_RESOURCE = 3; 36 /** 37 * Internal error 38 */ 39 public static final int SERVER_ERROR = 4; 40 /** 41 * The account name does not match an email regexp 42 */ 43 public static final int INVALID_EMAIL = 5; 44 /** 45 * The login does not exist or does match the password 46 */ 47 public static final int INVALID_LOGIN = 6; 48 /** 49 * The account has not been activated 50 */ 51 public static final int NONACTIVATED_ACCOUNT = 7; 52 /** 53 * The session has timed out 54 */ 55 public static final int SESSION_TIMEOUT = 8; 56 /** 57 * The browser has not accepted the session cookie 58 */ 59 public static final int COOKIE_ERROR = 9; 60 /** 61 * The user is not loggin in 62 */ 63 public static final int NOT_LOGGED_IN = 10; 64 /** 65 * The EULA has not been approved 66 */ 67 public static final int EULA_NOT_APPROVED = 11; 68 /** 69 * The account does not exist 70 */ 71 public static final int INEXISTING_ACCOUNT = 12; 72 73 private int _id; 74 public AccountServiceException() { 75 super(); 76 } 77 public AccountServiceException(int id) { 78 this(); 79 _id = id; 80 } 81 public AccountServiceException(int id, Throwable cause) { 82 super(cause); 83 _id = id; 84 } 85 public int getId() { 86 return _id; 87 } 88 }