-
-
Notifications
You must be signed in to change notification settings - Fork 47
Description
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 }
endThis makes it explicit that the error_notifier applies globally and is intended solely for internal error reporting.