[ 
https://issues.apache.org/jira/browse/IGNITE-18059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17627591#comment-17627591
 ] 

Igor Sapego commented on IGNITE-18059:
--------------------------------------

[~ptupitsyn] looks good to me

> .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)

Reply via email to