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

Added check key not found#30

Merged
clicman merged 2 commits intomasterfrom
fix/stash
Mar 22, 2019
Merged

Added check key not found#30
clicman merged 2 commits intomasterfrom
fix/stash

Conversation

@SandraBarmina
Copy link
Copy Markdown
Contributor

Добавила обработку ситуации, когда ключ не найден

* @return an object found by specified key
*/
public static <T> T getValue(String key) {
public static <T> T getValue(String key) throws DataException {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Теперь во всех методах где используется взятие значение из стеша придется придется добавлять throws DataException в сигнатуру. Мы точно этого хотим? Может рантайм бросать всё же?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вот я этого очень сильно не хочу, но у вас почему-то все вообще исключения обязывают их прокидывать. Думала, это правило. Если нет, скажи что нужно кидать или может запилить ошибку какую для этого случая?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну мне больше нравиться решение создать какого-нибудь StashKeyNotFoundException который наследует RuntimeException и кидать его

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Окей, сейчас сделаю

change type exception
@clicman clicman merged commit 5239dd1 into master Mar 22, 2019
clicman added a commit to sbtqa/page-factory-2 that referenced this pull request Mar 22, 2019
Features:
* Get non-value as json string sbtqa/datajack#31
* Strict key existance for Stash sbtqa/datajack#30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants