Skip to content

User definable list of ignored errors - #98

Open
multiscan wants to merge 4 commits into
fractaledmind:mainfrom
multiscan:feat/configurable_ignored_errors
Open

User definable list of ignored errors#98
multiscan wants to merge 4 commits into
fractaledmind:mainfrom
multiscan:feat/configurable_ignored_errors

Conversation

@multiscan

Copy link
Copy Markdown

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.

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.
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.

1 participant