You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pavel Tupitsyn (Jira)" <ji...@apache.org> on 2022/11/02 06:23:00 UTC

[jira] [Updated] (IGNITE-18059) .NET: Thin 3.0: Error codes should be constants

     [ https://issues.apache.org/jira/browse/IGNITE-18059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Tupitsyn updated IGNITE-18059:
------------------------------------
    Description: 
Currently, error codes in generated *ErrorGroups* class are *static readonly int*, because we calculate them at runtime with *GetFullCode*.

However, this prevents pattern matching. The following does not work:
{code}
if (e is IgniteClientConnectionException { Code: ErrorGroups.Client.ClusterIdMismatch })
{
    ...
}
{code}

Compiler error: *[CS0150] A constant value is expected*.

Since we use code generation, it is easy to compute error codes at compile time and use constants to make things nicer for the users.

> .NET: Thin 3.0: Error codes should be constants
> -----------------------------------------------
>
>                 Key: IGNITE-18059
>                 URL: https://issues.apache.org/jira/browse/IGNITE-18059
>             Project: Ignite
>          Issue Type: Improvement
>          Components: platforms, thin client
>            Reporter: Pavel Tupitsyn
>            Assignee: Pavel Tupitsyn
>            Priority: Major
>              Labels: .NET, ignite-3
>             Fix For: 3.0.0-beta2
>
>
> Currently, error codes in generated *ErrorGroups* class are *static readonly int*, because we calculate them at runtime with *GetFullCode*.
> However, this prevents pattern matching. The following does not work:
> {code}
> if (e is IgniteClientConnectionException { Code: ErrorGroups.Client.ClusterIdMismatch })
> {
>     ...
> }
> {code}
> Compiler error: *[CS0150] A constant value is expected*.
> Since we use code generation, it is easy to compute error codes at compile time and use constants to make things nicer for the users.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)