-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added minimal-py312-cuda11.8-inference environment #3765
base: main
Are you sure you want to change the base?
Conversation
except Exception as e: | ||
error = str(e) | ||
|
||
return AMLResponse({'error': error}, 500, json_str=True) |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium test
Stack trace information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 3 days ago
To fix the problem, we should avoid exposing detailed error messages to the end user. Instead, we can log the detailed error message on the server and return a generic error message to the client. This approach ensures that sensitive information is not exposed while still allowing developers to access the necessary details for debugging.
- Modify the exception handling block to log the detailed error message.
- Return a generic error message to the client.
-
Copy modified lines R32-R36
@@ -31,4 +31,6 @@ | ||
except Exception as e: | ||
error = str(e) | ||
|
||
return AMLResponse({'error': error}, 500, json_str=True) | ||
error_message = str(e) | ||
# Log the detailed error message | ||
print(f"Error occurred: {error_message}") | ||
# Return a generic error message to the client | ||
return AMLResponse({'error': 'An internal error has occurred.'}, 500, json_str=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please complete new image onboarding process
Added minimal-py312-cuda11.8-inference environment