Skip to content

Commit 23001c2

Browse files
committed
code clean
1 parent 490f89b commit 23001c2

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

pkg/aloha/service/api/v0.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async def handle_post(request: Request, **kwargs):
7575
# Get body for POST
7676
try:
7777
body = await request.json()
78-
except:
78+
except Exception:
7979
body = {}
8080

8181
kwargs.update(body)

pkg/aloha/service/api/v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async def handle_post(request: Request, token_payload: Dict = Depends(verify_v2_
113113

114114
try:
115115
body = await request.json()
116-
except:
116+
except Exception:
117117
body = {}
118118

119119
kwargs = body

pkg/aloha/service/http/base_api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def get_headers(self, *args, **kwargs) -> dict:
4545
"""Build the default request headers used by aloha clients."""
4646
headers = {
4747
"Content-Type": "application/json",
48-
"Request-ID": str(uuid.uuid1()),
48+
"Request-ID": str(uuid.uuid4()),
4949
}
5050
return headers
5151

pkg/aloha/service/openapi/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ def get_access_token(self) -> str:
6868
expires_in = int(data["expires_in"])
6969
self.expires_at = datetime.now() + timedelta(minutes=expires_in - 1)
7070
except Exception as e:
71-
LOG.error("Exception acquiring ESG access token from [%s]: %s" % (self.url_oauth_get_token, str(e)))
71+
msg = "Exception acquiring ESG access token from [%s]: %s" % (self.url_oauth_get_token, str(e))
72+
LOG.error(msg)
7273

7374
return self.access_token
7475

pkg/aloha/service/web.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async def post_handler(request: Request):
8989

9090
try:
9191
body = await request.json()
92-
except:
92+
except Exception:
9393
body = {}
9494

9595
kwargs.update(body)
@@ -164,7 +164,7 @@ async def default_handler(request: Request):
164164

165165
try:
166166
body = await request.json()
167-
except:
167+
except Exception:
168168
body = {}
169169

170170
kwargs.update(body)

0 commit comments

Comments
 (0)