🐛 fix(service.py): remove unnecessary try-except block and return statement to improve code readability and maintainability
This commit is contained in:
parent
6615bf3b03
commit
5a8ba5f0db
1 changed files with 2 additions and 7 deletions
|
|
@ -199,13 +199,8 @@ class StoreService(Service):
|
|||
self.components_url, headers=headers, json=component_dict
|
||||
)
|
||||
response.raise_for_status()
|
||||
# ! If the user does not have permission to a certain field
|
||||
# the request returns 204 and no data
|
||||
try:
|
||||
component = response.json()["data"]
|
||||
return ComponentResponse(**component)
|
||||
except json.JSONDecodeError:
|
||||
return ComponentResponse(**component_dict)
|
||||
component = response.json()["data"]
|
||||
return ComponentResponse(**component)
|
||||
except HTTPError as exc:
|
||||
if response:
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue