Closed FrancisVarga closed 3 weeks ago
Currently you can use Python Try Except
, the return format only in dict with few format.
def main():
try:
x = 1 / 0
except Exception as e:
x = 0
error_message = str(e)
return{
"number": x,
"debug": error_message
}
I hope this helps. Please let me know if you have any other questions.
Regarding the sandbox(the engine for Code Execution), please refer to this: https://github.com/langgenius/dify-sandbox
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
Debugging code is hard, possible to have the print or anything returned to the frontend or any form of logging.
2. Additional context or comments
No response
3. Can you help us with this feature?