Skip to content

Commit 56cacb9

Browse files
committed
Fix IndentationError by converting docstring to comment in except block
1 parent b5da268 commit 56cacb9

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

cogs/openAiCog.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ async def gen_img(self, ctx, *args):
122122
os.remove(image_filename)
123123
# TODO: add to database
124124
except BadRequestError as e:
125-
"""
126-
openai.BadRequestError: Error code: 400 - {'error': {'code': 'content_policy_violation', 'message': 'Your request was rejected as a result of our safety system. Your prompt may contain text that is not allowed by our safety system.', 'param': None, 'type': 'invalid_request_error'}}
127-
"""
125+
# openai.BadRequestError: Error code: 400 - {'error': {'code': 'content_policy_violation', 'message': 'Your request was rejected as a result of our safety system. Your prompt may contain text that is not allowed by our safety system.', 'param': None, 'type': 'invalid_request_error'}}
128126
if e.code == 400:
129127
if e.code == "content_policy_violation":
130128
await ctx.send("Your prompt was rejected by OpenAI's safety system due to content policy violation")

0 commit comments

Comments
 (0)