Skip to content

Commit 77388d6

Browse files
SP-582 Python - Implement better refund exceptions - fix code style
1 parent 50d07f6 commit 77388d6

File tree

2 files changed

+112
-58
lines changed

2 files changed

+112
-58
lines changed

src/bitpay/utils/token_container.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ def get_access_token(self, facade: Facade) -> str:
1212
"""
1313
:raises BitPayGenericException
1414
"""
15-
token = None
1615
try:
17-
token = self.__data[facade]
16+
return self.__data[facade]
1817
except Exception as exe:
1918
BitPayExceptionProvider.throw_generic_exception_with_message(
2019
"There is no token for the specified key: " + facade.value
2120
)
22-
raise BitPayException
21+
raise BitPayException
2322

2423
def put(self, key: Facade, value: str) -> None:
2524
self.__data[key] = value

0 commit comments

Comments
 (0)