fix: remove Sentry error logging for streaming configurations
Changes
- Add proper error handling in GraphQL mutations to prevent validation errors from being logged to Sentry
- Handle ActiveRecord::RecordInvalid exceptions for streaming audit event destination validation failures
- Convert validation errors to user-friendly GraphQL errors instead of logging to Sentry
Validation
Prerequisites
- You need Owner permissions on a group to test group-level destinations
- You need Admin permissions on the instance to test instance-level destinations
1. Test Group External Audit Event Destinations
Navigate to Group Settings:
- Go to your group -> Secure -> Audit Events -> Streams
- Click "Add streaming destination"
Test Scenario 1 - Name Too Long:
- Fill in the form:
-
Destination URL:
https://example.com/webhook -
Name: Enter exactly 73 characters (e.g.,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
-
Destination URL:
- Click "Add destination"
- Expected Result: You should see a user-friendly error message instead of a generic server error
- Verify: No new Sentry errors are logged for this validation failure
Test Scenario 2 - Limit Exceeded:
- First, create 5 streaming destinations (if the limit is 5)
- Try to create a 6th destination
- Expected Result: You should see an error message about exceeding the maximum limit
- Verify: No Sentry errors are logged
2. Test Instance External Audit Event Destinations
Navigate to Admin Settings:
- Go to Admin Area -> Monitoring ->Audit Events -> Streams
- Click "Add streaming destination"
Test the same scenarios as above:
- Name too long (73+ characters)
- Limit exceeded (create 5, then try a 6th)
3. Verification Steps
Before this fix:
- Validation errors would show as generic "Something went wrong" messages
- Internal server errors (500) would be returned
- Sentry would log these as exceptions
After this fix:
- Clear, specific error messages are displayed
- Proper GraphQL validation errors (not 500s)
- No Sentry logging for expected validation failures
4. Browser Developer Tools Check
- Open browser Developer Tools (F12)
- Go to Network tab
- Perform the test scenarios above
- Check the GraphQL responses:
- Should return proper error messages in the response
- HTTP status should be 200 (not 500)
- Error messages should be user-friendly
Relates to issue #558411 (closed)
Edited by Nate Rosandich
