Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-18059

.NET: Thin 3.0: Error codes should be constants

    XMLWordPrintableJSON

Details

    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:

      if (e is IgniteClientConnectionException { Code: ErrorGroups.Client.ClusterIdMismatch })
      {
          ...
      }
      

      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.

      Attachments

        Activity

          People

            ptupitsyn Pavel Tupitsyn
            ptupitsyn Pavel Tupitsyn
            Igor Sapego Igor Sapego
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 10m
                10m