Skip to content

Commit 54a03d8

Browse files
author
Kevin Hellemun
committed
Extracted magic value into constant. (#102)
1 parent 8005f05 commit 54a03d8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bunq/sdk/json/adapters.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ def serialize(cls, installation):
140140

141141

142142
class SessionServerAdapter(converter.JsonAdapter):
143+
# Error constants.
144+
_ERROR_COULD_NOT_DETERMINE_USER = 'Could not determine user.'
145+
143146
# Id constants
144147
_ATTRIBUTE_ID = '_id_'
145148
_INDEX_ID = 0
@@ -209,7 +212,7 @@ def deserialize(cls, target_class, array):
209212
user_dict_wrapped[cls._FIELD_USER_API_KEY]
210213
)
211214
else:
212-
raise BunqException('Could not determine user.')
215+
raise BunqException(cls._ERROR_COULD_NOT_DETERMINE_USER)
213216

214217
return session_server
215218

0 commit comments

Comments
 (0)