Skip to content

Commit

Permalink
fix(logger): Change error log to warning log in SDK files
Browse files Browse the repository at this point in the history
  • Loading branch information
sudoskys committed Feb 17, 2024
1 parent a03a433 commit b941158
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/novelai_python/sdk/ai/generate_image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ async def request(self,
data=json.dumps(request_data).encode("utf-8")
)
if response.headers.get('Content-Type') not in ['binary/octet-stream', 'application/x-zip-compressed']:
logger.error(
logger.warning(
f"Error with content type: {response.headers.get('Content-Type')} and code: {response.status_code}"
)
try:
Expand Down
2 changes: 1 addition & 1 deletion src/novelai_python/sdk/ai/generate_image/suggest_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async def request(self,
url=self.base_url + "?" + "&".join([f"{k}={v}" for k, v in request_data.items()])
)
if "application/json" not in response.headers.get('Content-Type') or response.status_code != 200:
logger.error(
logger.warning(
f"Error with content type: {response.headers.get('Content-Type')} and code: {response.status_code}"
)
try:
Expand Down
2 changes: 1 addition & 1 deletion src/novelai_python/sdk/ai/upscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async def request(self,
data=json.dumps(request_data).encode("utf-8")
)
if response.headers.get('Content-Type') not in ['binary/octet-stream', 'application/x-zip-compressed']:
logger.error(
logger.warning(
f"Error with content type: {response.headers.get('Content-Type')} and code: {response.status_code}"
)
try:
Expand Down
2 changes: 1 addition & 1 deletion src/novelai_python/sdk/user/information.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async def request(self,
self.base_url
)
if "application/json" not in response.headers.get('Content-Type') or response.status_code != 200:
logger.error(
logger.warning(
f"Error with content type: {response.headers.get('Content-Type')} and code: {response.status_code}"
)
try:
Expand Down
2 changes: 1 addition & 1 deletion src/novelai_python/sdk/user/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ async def request(self,
data=json.dumps(request_data).encode("utf-8")
)
if "application/json" not in response.headers.get('Content-Type') or response.status_code != 201:
logger.error(
logger.warning(
f"Error with content type: {response.headers.get('Content-Type')} and code: {response.status_code}"
)
try:
Expand Down
2 changes: 1 addition & 1 deletion src/novelai_python/sdk/user/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def request(self,
url=self.base_url,
)
if "application/json" not in response.headers.get('Content-Type') or response.status_code != 200:
logger.error(
logger.warning(
f"Error with content type: {response.headers.get('Content-Type')} and code: {response.status_code}"
)
try:
Expand Down

0 comments on commit b941158

Please sign in to comment.