[SERVER-42954] Allow ErrorCategories to be explicit supersets Created: 21/Aug/19  Updated: 06/Dec/22  Resolved: 24/Feb/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Benjamin Caimano (Inactive) Assignee: Backlog - Service Architecture
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Service Arch
Participants:

 Description   

As is, each entry in "error_categories" in error_codes.yml is a simple string value. It should be possible for these to instead be like so:

error_categories:
    - ShutdownError
    - {name: "CancelationError", subcategories: ["ShutdownError"],}

Each category should be a superset that consists of the codes for all of its subcategories as well as each code that lists it as a category. For instance, CancelationError would list ShutdownError as a subcategory.



 Comments   
Comment by Lauren Lewis (Inactive) [ 24/Feb/22 ]

We haven’t heard back from you for at least one calendar year, so this issue is being closed. If this is still an issue for you, please provide additional information and we will reopen the ticket.

Comment by Benjamin Caimano (Inactive) [ 28/Aug/19 ]

I mean, sure. "supersetOf" or "isAlso" might be more clear.

For the record, I'm not sure the schema is properly normalized if an object refers to another object in the same list. It probably is more normalized if there is a third list of (superset, subset) tuples. This does trend hard into pedantry all over though.

Comment by Billy Donahue [ 27/Aug/19 ]

I don't have an opinion on the merits of ErrorCategory hierarchy. I do have an opinion on YAML, though. Whatever we decide to do here, I would like to keep the YAML schema regular, so we don't have different types in the error_categories array, with some elements scalar, and some elements property maps. And following the error_codes declarations, I would prefer to have each category declare its membership in a superior category in a bottom-up fashion, rather than the other way around. So it would be more like:

error_categories:
 - {name: CancelationError}
 - {name: ShutdownError, isa: [CancelationError]}

 

Generated at Thu Feb 08 05:01:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.