feat(api): Invalid ID error message
This commit is contained in:
@@ -63,6 +63,7 @@ async def handle_download(
|
|||||||
else:
|
else:
|
||||||
cookies = None
|
cookies = None
|
||||||
|
|
||||||
|
try:
|
||||||
match mode:
|
match mode:
|
||||||
case DownloadMode.story:
|
case DownloadMode.story:
|
||||||
story_id = download_id
|
story_id = download_id
|
||||||
@@ -99,6 +100,13 @@ async def handle_download(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
except KeyError:
|
||||||
|
# Invalid ID
|
||||||
|
return HTMLResponse(
|
||||||
|
status_code=404,
|
||||||
|
content='The story you tried to download does not exist or has been deleted. Support is available on the <a href="https://discord.gg/P9RHC4KCwd" target="_blank">Discord</a>',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
app.mount("/", StaticFiles(directory=BUILD_PATH), "static")
|
app.mount("/", StaticFiles(directory=BUILD_PATH), "static")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user