Update main.py
Browse files
main.py
CHANGED
|
@@ -5,6 +5,7 @@ from enkanetwork import EnkaNetworkAPI
|
|
| 5 |
from starrailcard.src.api import enka
|
| 6 |
import concurrent.futures
|
| 7 |
import requests
|
|
|
|
| 8 |
from fastapi import FastAPI,Query
|
| 9 |
from io import BytesIO
|
| 10 |
from fastapi.responses import JSONResponse
|
|
@@ -146,10 +147,14 @@ def root():
|
|
| 146 |
async def root():
|
| 147 |
try:
|
| 148 |
# Update assets using encbanner
|
| 149 |
-
result = await encbanner.update()
|
| 150 |
return JSONResponse(content={'response': 'Assets updated successfully', 'result': result})
|
| 151 |
except Exception as e:
|
| 152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
# Helper function to upload the image to Cloudinary
|
| 155 |
def upload_image(data, character_id, player_id):
|
|
|
|
| 5 |
from starrailcard.src.api import enka
|
| 6 |
import concurrent.futures
|
| 7 |
import requests
|
| 8 |
+
import traceback
|
| 9 |
from fastapi import FastAPI,Query
|
| 10 |
from io import BytesIO
|
| 11 |
from fastapi.responses import JSONResponse
|
|
|
|
| 147 |
async def root():
|
| 148 |
try:
|
| 149 |
# Update assets using encbanner
|
| 150 |
+
result = await encbanner.update()
|
| 151 |
return JSONResponse(content={'response': 'Assets updated successfully', 'result': result})
|
| 152 |
except Exception as e:
|
| 153 |
+
error_details = traceback.format_exc()
|
| 154 |
+
return JSONResponse(
|
| 155 |
+
content={'error': f'UNKNOWN ERR: {str(e)}', 'details': error_details},
|
| 156 |
+
status_code=500
|
| 157 |
+
)
|
| 158 |
|
| 159 |
# Helper function to upload the image to Cloudinary
|
| 160 |
def upload_image(data, character_id, player_id):
|