mirror of
https://github.com/UnlegitDqrk/Potato.git
synced 2025-10-02 06:30:15 +02:00
Add bakeTime to BurntException
This commit is contained in:
@@ -9,8 +9,8 @@ public class BurntException extends Exception {
|
||||
super("Potato is badly burnt by trying to boil it at " + degrees + " degrees!!");
|
||||
}
|
||||
|
||||
public BurntException() {
|
||||
super("Potato is badly burnt by baking for too long!");
|
||||
public BurntException(long bakeTime) {
|
||||
super("Potato is badly burnt by baking for too long!! (" + bakeTime + "ms)");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -86,7 +86,7 @@ public class Potato implements Tuber {
|
||||
connection.connect();
|
||||
int inOven = connection.getResponseCode();
|
||||
long bakeTime = (System.currentTimeMillis() - begin);
|
||||
if (bakeTime > 1100) throw new BurntException();
|
||||
if (bakeTime > 1100) throw new BurntException(bakeTime);
|
||||
return inOven == 200;
|
||||
} catch (IOException ex) {
|
||||
throw new OvenException(ex);
|
||||
|
Reference in New Issue
Block a user