remove 417 (use 409) and reword 418 msg

remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-10-12 02:00:18 -07:00
parent 5377472146
commit 96879894af
3 changed files with 3 additions and 7 deletions

View File

@ -284,8 +284,7 @@ ERROR_TITLES = {
409: "Conflict",
413: "Payload Too Large",
415: "Unsupported Media Type",
417: "Image already exists!",
418: "WEBM videos are not allowed",
418: "I'm a teapot",
429: "Too Many Requests",
500: "Internal Server Error",
}
@ -300,8 +299,7 @@ ERROR_MSGS = {
409: "There's a conflict between what you're trying to do and what you or someone else has done and because of that you can't do what you're trying to do. So maybe like... don't try and do that? Sorry not sorry",
413: "That's a heckin' chonker of a file! Please make it smaller or maybe like upload it somewhere else idk",
415: "Please upload only Image, Video, or Audio files!",
417: "Image already exists!",
418: "Please convert your video to MP4 and re-upload it!",
418: "this really shouldn't happen now that we autoconvert webm files but if it does there's a cool teapot marsey so there's that",
429: "go spam somewhere else nerd",
500: "Hiiiii it's carp! I think this error means that there's a timeout error. And I think that means something took too long to load so it decided not to work at all. If you keep seeing this on the same page <I>but not other pages</I>, then something is probably wrong with that specific function. It may not be called a function, but that sounds right to me. Anyway, ping me and I'll whine to someone smarter to fix it. Don't bother them. Thanks ily &lt;3",
}

View File

@ -182,7 +182,7 @@ def process_image(filename=None, resize=0, trim=False, uploader=None, patron=Fal
i_hash = str(imagehash.phash(i))
if i_hash in hashes.keys():
os.remove(filename)
abort(417)
abort(409, "Image already exists!")
db = db or g.db

View File

@ -17,9 +17,7 @@ from files.__main__ import app, limiter
@app.errorhandler(406)
@app.errorhandler(409)
@app.errorhandler(413)
@app.errorhandler(414)
@app.errorhandler(415)
@app.errorhandler(417)
@app.errorhandler(418)
@app.errorhandler(429)
def error(e):