[
https://issues.apache.org/jira/browse/IGNITE-14931?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vyacheslav Koptilin updated IGNITE-14931:
-----------------------------------------
Fix Version/s: 3.0.0-alpha6
> Define common error scopes and prefix
> -------------------------------------
>
> Key: IGNITE-14931
> URL: https://issues.apache.org/jira/browse/IGNITE-14931
> Project: Ignite
> Issue Type: Sub-task
> Reporter: Vyacheslav Koptilin
> Assignee: Vyacheslav Koptilin
> Priority: Major
> Labels: iep-84, ignite-3
> Fix For: 3.0.0-alpha6
>
> Time Spent: 2h 20m
> Remaining Estimate: 0h
>
> Error groups and error codes
> First proposed abstraction is a concept of error groups. It is similar to
> what was called an ErrorScope in [Devlist
> Discussion|https://lists.apache.org/thread/l20pp2ws06zt86b33jo851ph1t56hqd0].
> The main idea is that all errors in Ignite will be grouped. The way to
> identify an error type is to have a pair - (group; code), where code
> represents an integer number, unique within a group.
> For example, (TABLE, 1) and (SQL, 1) are both valid errors despite the
> apparent collision.
> Each group defines a collection of errors that belong to a single
> component/module/vendor. For example, RAFT, TABLE or SQL. It is convenient to
> have an integer code for groups as well, so that users won’t have to compare
> strings in their code. Hence each group must be identified by a unique name
> and code. See class ErrorGroup for the reference. Uniqueness must be
> guaranteed by a newGroup method, which is a single point to create new error
> groups.
> So, each error type could be represented in two different ways - as a
> human-readable string and as an integer number. First is used exclusively in
> text - logs and error messages. Second - exclusively in code:
> Name should be formatted like this: IGN-XXX-nnn, where XXX is a group name
> and nnn is an unique error code within a group. Additional IGN prefix will
> simplify googling the error.
> Number code should be calculated using following code fragment:
> (groupCode <<< 16) | (0xFFFF & errorCode).
> This restricts all group codes and individual error codes to 16 bits only,
> which is still more than enough.
> So, numeric error code includes both group code and an internal unique code.
> These codes should be stored in constants and be documented.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)