Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Tarun-Chevula
Copy link
Contributor

Added minimal-py312-cuda11.8-inference environment

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
flows to this location and may be exposed to an external user.

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.

  1. Modify the exception handling block to log the detailed error message.
  2. Return a generic error message to the client.
Suggested changeset 1
assets/inference/environments/minimal-py312-cuda11.8-inference/tests/src/valid_score.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/assets/inference/environments/minimal-py312-cuda11.8-inference/tests/src/valid_score.py b/assets/inference/environments/minimal-py312-cuda11.8-inference/tests/src/valid_score.py
--- a/assets/inference/environments/minimal-py312-cuda11.8-inference/tests/src/valid_score.py
+++ b/assets/inference/environments/minimal-py312-cuda11.8-inference/tests/src/valid_score.py
@@ -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)
EOF
@@ -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)
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Copy link
Contributor

@vizhur vizhur left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants