SelectoComponents.ErrorHandling.ErrorSanitizer (selecto_components v0.3.21)

Sanitizes error messages for production environments to prevent sensitive information leakage.

Link to this section Summary

Functions

Determines if the current environment is production.

Returns production-safe suggestions based on error type.

Sanitizes error details map for production.

Sanitizes an error for display based on the current environment. In production, removes sensitive details like SQL queries, parameters, and stack traces.

Sanitizes suggestions to be production-safe.

Returns a safe, user-friendly error message based on error type.

Link to this section Functions

Link to this function

production_env?()

Determines if the current environment is production.

Link to this function

safe_suggestions(error_type)

Returns production-safe suggestions based on error type.

Link to this function

sanitize_details(details, opts \\ [])

Sanitizes error details map for production.

Link to this function

sanitize_error(error, opts \\ [])

Sanitizes an error for display based on the current environment. In production, removes sensitive details like SQL queries, parameters, and stack traces.

Link to this function

sanitize_suggestions(suggestions)

Sanitizes suggestions to be production-safe.

Link to this function

user_friendly_message(error_type)

Returns a safe, user-friendly error message based on error type.