Skip to content

objectpool: Fix error code when trying to recreate existing pool

Patrick Steinhardt requested to merge pks-objectpool-fix-error-code into master

With the recent refactorings to create object pools atomically the error code has changed when the target exists from FailedPrecondition to AlreadyExists. While the latter is arguably better, Rails' rspecs still expect the former error code.

Fix this by overriding the error code so that for the time being we abide and use whatever Rails wants to see. Eventually though we should fix this to return AlreadyExists so that we're consistent with all the other repository-creating functions.

Changelog: fixed

Merge request reports