Logging complete structured errors may expose personal data, queries, and source code
Source references: 6Examples place a user email and database query in the error object, while a configuration example enables source fragments; the Skill then recommends JSON serialization or passing the whole error to a logger. Because attributes travel with the error, these values may arrive together in centralized logs or error tracking.
Log readers or third-party monitoring services could receive user identifiers, email addresses, internal SQL, business data, or application source code. Selecting request or response body inclusion would further expose tokens or submitted content.
These are examples, not evidence of execution. If adopted, however, error objects can contain email addresses and SQL queries and may then be serialized wholesale into logs. The advanced configuration also explicitly makes source fragments visible. Sending such errors to centralized logging or a third-party tracker could disclose personal data, query structure, and internal source. Users can ask for source fragments to be hidden by default and for request, query, and user fields to be filtered or redacted before logging.
return nil, oops. In("user-repository"). Tags("database", "postgres"). With("query", query). With("user_id", id). Wrapf(err, "failed to fetch user from database") }Show 5 other places
Tags("orders", "checkout"). Tenant(req.TenantID, "plan", req.Plan). User(req.UserID, "email", req.UserEmail)```gooops.StackTraceMaxDepth = 20 // adjust stack trace depthoops.SourceFragmentsHidden = false // enable source code fragmentsloc, _ := time.LoadLocation("America/New_York")```gofmt.Printf("%+v\n", err) // verbose with stack tracebytes, _ := json.Marshal(err) // JSON for loggingslog.Error(err.Error(), slog.Any("error", err)) // slog integration``` Code("network_failure"). // machine-readable identifier User("user-123", "email", "foo@bar.com"). // user context With("query", query). // custom attributes Errorf("failed to fetch user: %s", "timeout")```func (r *UserRepository) FetchUser(id string) (*User, error) { query := "SELECT * FROM users WHERE id = $1" row, err := r.db.Query(query, id) if err != nil { return nil, oops. In("user-repository"). Tags("database", "postgres"). With("query", query). With("user_id", id). Wrapf(err, "failed to fetch user from database") }