Skip to content

Remove error_notifier from public API #482

@bolshakov

Description

@bolshakov

The error_notifier option has never been documented in the README and may cause confusion for users.

In the Stoplight function documentation, it’s currently described as:

# @option settings [Proc] :error_notifier A proc to handle error notifications.

This phrasing could misleadingly suggest that the proc reports any errors occurring during the execution of user code. However, this is not the case. The error_notifier is used internally by Stoplight to report internal failures - for example, when the Redis data store fails. In such cases, Stoplight falls back to the in-memory data store while using this notifier to log or report the internal error.

To make its purpose clearer and prevent misuse, I propose moving this configuration option to the global configuration only, disallowing per-light configuration.

Stoplight.configure do |config|
  config.error_notifier = ->(error) { warn error }
end

This makes it explicit that the error_notifier applies globally and is intended solely for internal error reporting.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions