Error-reporting examples may disclose user identifiers and request URLs to a monitoring service
Source references: 2The client example reports a user ID and page path; the server example reports a user ID and `req.url`. Request URLs can contain tokens, email addresses, search terms, or other personal data in query parameters. No redaction, query filtering, or authorization requirement is stated.
If adopted directly, the error-tracking provider, its personnel, or anyone with monitoring access could receive identifiers and sensitive URL content, creating privacy, compliance, or credential-exposure risk.
The examples explicitly pass page paths and user IDs to an error-reporting function, and the server passes the raw `req.url`. If `reportError` is connected to a third-party service, or URLs contain query parameters, identifiers, tokens, or user input could reach an external monitoring account. The nearby guidance does not require query removal, redaction, or collection limits. Users can ask who receives the data, how long it is retained, and require URL filtering and minimized user identifiers by default.
class ErrorBoundary extends React.Component { componentDidCatch(error: Error, info: React.ErrorInfo) { // Report to error tracking service reportError(error, { componentStack: info.componentStack, userId: getCurrentUser()?.id, page: window.location.pathname, }); }Show 1 other places
// Server-side error reportingapp.use((err: Error, req: Request, res: Response, next: NextFunction) => { reportError(err, { method: req.method, url: req.url, userId: req.user?.id, });