Closed (fixed)
Project:
Search API
Version:
8.x-1.x-dev
Component:
Plugins
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Dec 2021 at 11:35 UTC
Updated:
19 Mar 2023 at 14:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
andregp commentedComment #3
drunken monkeyNormally,
\Throwableare more serious errors which I’d be hesitant to catch. Can you provide a specific example of the kind of error you’d want to catch?Comment #4
jrockowitz commentedThe errors that I need to catch are usually related to a node not being renderable on a very large site, and Search API seems to be the only system that is catching the error.
Also, when a fatal error occurs during indexing, it immediately becomes a critical issue because no content is being indexed vs. one node not being indexed, which is a minor issue.
Comment #5
miarynah commented@drunken monkey
in my case, some node on more than 2k nodes has error while redering content as rendered_item in index field and indexing is stoped immediatly. The error was an url rendering in twig and not be catched by the default exception. This patch catch the error and keep indexing.
Note that these node was test content and we can't identify wich of 2k nodes it is
Comment #6
drunken monkeyOK, I guess this does make sense. We want as little chance as possible of something just terminating the whole indexing process, and as we can’t guarantee that other code doesn’t contain fatal bugs, we should just catch everything we can.
Little problem is that we’d also need to adapt the signature of
LoggerTrait::logException()to still be able to use it with\Errorinstances as well. However, for a trait, I don’t think such a change is a BC problem at all, since overriding trait methods works differently than for classes/interfaces. However, I still created a change record for it.Please test/review!
Comment #7
drunken monkeyComment #9
drunken monkeyPlease test/review so I can commit.
Comment #11
drunken monkeyWell, I’m reasonably certain that this won’t break anything major, so just committed this now.