Skip to content

User definable list of ignored errors - #98

Merged
fractaledmind merged 6 commits into
fractaledmind:mainfrom
multiscan:feat/configurable_ignored_errors
Oct 13, 2026
Merged

fractaledmind merged 6 commits into
fractaledmind:mainfrom
multiscan:feat/configurable_ignored_errors

Conversation

@multiscan

Copy link
Copy Markdown
Contributor

This PR enable the user to configure a list of error names that will be added to the hard-coded default list of ignored errors that is defined in lib/solid_errors/subscriber.rb.
A minor refactoring of the way IGNORED_ERRORS is built is also introduced for efficiency and compatibility reasons: the current approach leaves the option to use classes instead of class names but it might lead to errors in case the class is not defined. Since only class names are actually present in the array, I think it is better to stick to them and simplify the lookup by using an hash (~2 times faster than array.include? on my machine for this array size).

A small fix is also proposed for the Occurrence model to imcrease compatibility with database not supporting direct json serialization. This is so tiny that I think a separate PR would be overkill.

multiscan and others added 6 commits September 9, 2026 18:24
this includes a slight refactoring of the way the IGNORED_ERRORS
array is built. The original code were allowing for class
objects to be passed. The feature is not used because it can
actually lead to exception when the class is not defined.
Instead of a loop lookup, I think it is faster to rely on
the keys of an hash.
# Conflicts:
#	test/models/solid_errors/occurrence_test.rb
The memoized lookup ignored any value set after the first error was
reported, and the Occurrence serialize change duplicated fractaledmind#101 while
querying the schema at class load. Classes and names both work.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@fractaledmind
fractaledmind merged commit 4b97d4e into fractaledmind:main Oct 13, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants