better error handling from venvs

This commit is contained in:
Believethehype
2023-12-30 20:36:38 +01:00
parent d2fbeb7b23
commit 0c2ee4ee6c
6 changed files with 22 additions and 11 deletions

View File

@@ -116,9 +116,9 @@ class ImageGenerationDALLE(DVMTaskInterface):
return result
except Exception as e:
print("Error in Module")
raise Exception(e)
if str(e).startswith("Error code: 400"):
raise Exception('Your request was rejected as a result of OpenAI´s safety system. Your prompt may '
'contain text that is not allowed by their safety system.')
# We build an example here that we can call by either calling this file directly from the main directory,
# or by adding it to our playground. You can call the example and adjust it to your needs or redefine it in the