You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

expection_code.go 3.2 kB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. package transaction
  18. type TransactionExceptionCode byte
  19. const (
  20. /**
  21. * Unknown transaction exception code.
  22. */
  23. TransactionExceptionCodeUnknown TransactionExceptionCode = iota
  24. /**
  25. * BeginFailed
  26. */
  27. TransactionExceptionCodeBeginFailed
  28. /**
  29. * Lock key conflict transaction exception code.
  30. */
  31. TransactionExceptionCodeLockKeyConflict
  32. /**
  33. * Io transaction exception code.
  34. */
  35. IO
  36. /**
  37. * Branch rollback failed retriable transaction exception code.
  38. */
  39. TransactionExceptionCodeBranchRollbackFailedRetriable
  40. /**
  41. * Branch rollback failed unretriable transaction exception code.
  42. */
  43. TransactionExceptionCodeBranchRollbackFailedUnretriable
  44. /**
  45. * Branch register failed transaction exception code.
  46. */
  47. TransactionExceptionCodeBranchRegisterFailed
  48. /**
  49. * Branch report failed transaction exception code.
  50. */
  51. TransactionExceptionCodeBranchReportFailed
  52. /**
  53. * Lockable check failed transaction exception code.
  54. */
  55. TransactionExceptionCodeLockableCheckFailed
  56. /**
  57. * Branch transaction not exist transaction exception code.
  58. */
  59. TransactionExceptionCodeBranchTransactionNotExist
  60. /**
  61. * Global transaction not exist transaction exception code.
  62. */
  63. TransactionExceptionCodeGlobalTransactionNotExist
  64. /**
  65. * Global transaction not active transaction exception code.
  66. */
  67. TransactionExceptionCodeGlobalTransactionNotActive
  68. /**
  69. * Global transaction status invalid transaction exception code.
  70. */
  71. TransactionExceptionCodeGlobalTransactionStatusInvalid
  72. /**
  73. * Failed to send branch commit request transaction exception code.
  74. */
  75. TransactionExceptionCodeFailedToSendBranchCommitRequest
  76. /**
  77. * Failed to send branch rollback request transaction exception code.
  78. */
  79. TransactionExceptionCodeFailedToSendBranchRollbackRequest
  80. /**
  81. * Failed to add branch transaction exception code.
  82. */
  83. TransactionExceptionCodeFailedToAddBranch
  84. /**
  85. * Failed to lock global transaction exception code.
  86. */
  87. TransactionExceptionCodeFailedLockGlobalTranscation
  88. /**
  89. * FailedWriteSession
  90. */
  91. TransactionExceptionCodeFailedWriteSession
  92. /**
  93. * Failed to holder exception code
  94. */
  95. FailedStore
  96. )
  97. type TransactionException struct {
  98. Code TransactionExceptionCode
  99. Message string
  100. }
  101. //Error 隐式继承 builtin.error 接口
  102. func (e TransactionException) Error() string {
  103. return "TransactionException: " + e.Message
  104. }

Go Implementation For Seata