Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit c9e6f3a

Browse files
committed
change type exception
1 parent 6ccfeec commit c9e6f3a

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

datajack-api/src/main/java/ru/sbtqa/tag/datajack/Stash.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import java.util.HashMap;
44
import java.util.Map;
5-
import ru.sbtqa.tag.datajack.exceptions.DataException;
5+
import ru.sbtqa.tag.datajack.exceptions.StashKeyNotFoundException;
66

77
/**
88
* Temporary data storage. Put data to this storage as key-value pair to use it
@@ -56,10 +56,10 @@ public static void put(String key, Object value) {
5656
* @param key the key as a {@link java.lang.String} object
5757
* @return an object found by specified key
5858
*/
59-
public static <T> T getValue(String key) throws DataException {
59+
public static <T> T getValue(String key) {
6060
Map vault = getThreadVault();
6161
if (!vault.containsKey(key)) {
62-
throw new DataException(String.format("Key '%s' not found in stash", key));
62+
throw new StashKeyNotFoundException(String.format("Key '%s' not found in stash", key));
6363
}
6464
return (T) getThreadVault().get(key);
6565
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package ru.sbtqa.tag.datajack.exceptions;
2+
3+
public class StashKeyNotFoundException extends RuntimeException {
4+
5+
public StashKeyNotFoundException(String message) {
6+
super(message);
7+
}
8+
9+
public StashKeyNotFoundException(String string, Throwable ex) {
10+
super(string, ex);
11+
}
12+
}

0 commit comments

Comments
 (0)