Files
sheepit-shadow-nabber/src/main/java/com/sheepit/client/exception/SheepItServerDown.java

44 lines
1.3 KiB
Java
Raw Normal View History

2015-07-08 19:44:38 +01:00
/*
* Copyright (C) 2015 Laurent CLOUET
* Author Laurent CLOUET <laurent.clouet@nopnop.net>
*
* This program is free software; you can redistribute it and/or
2015-07-08 19:44:38 +01:00
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2
* of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package com.sheepit.client.exception;
2023-12-07 15:29:58 +00:00
import java.util.concurrent.ThreadLocalRandom;
2015-07-08 19:44:38 +01:00
/**
* Server down (server side error) or unreachable (client side error)
*/
2023-12-07 15:29:58 +00:00
public class SheepItServerDown extends SheepItExceptionWithRequiredWait {
2023-01-28 11:45:20 +00:00
public SheepItServerDown() {
2015-07-08 19:44:38 +01:00
super();
}
2023-01-28 11:45:20 +00:00
public SheepItServerDown(String message_) {
2015-07-08 19:44:38 +01:00
super(message_);
}
2023-12-07 15:29:58 +00:00
public String getHumanText() {
return "Cannot connect to the server. Please check your connectivity. Will try again at %tR";
}
public int getWaitDuration() {
return 1000 * 60 * ThreadLocalRandom.current().nextInt(10, 30 + 1);
}
2015-07-08 19:44:38 +01:00
}