lib/errors: Add new classifiedError type
Created by: indradhanush
Part of #38612.
Fixes #38615 (closed).
This error type is not used at the moment.
But it will be the next step.
Test plan
New code that is not used anywhere yet. Also added some minimal tests to ensure this works for now. Will build upon it in future PRs.