github.com/team-ide/go-dialect@v1.9.20/vitess/vterrors/constants.go (about) 1 /* 2 Copyright 2021 The Vitess Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package vterrors 18 19 import "regexp" 20 21 // Operation not allowed error 22 const ( 23 NotServing = "operation not allowed in state NOT_SERVING" 24 ShuttingDown = "operation not allowed in state SHUTTING_DOWN" 25 ) 26 27 // RxOp regex for operation not allowed error 28 var RxOp = regexp.MustCompile("operation not allowed in state (NOT_SERVING|SHUTTING_DOWN)") 29 30 // TxEngineClosed for transaction engine closed error 31 const TxEngineClosed = "tx engine can't accept new connections in state %v" 32 33 // RxTxEngineClosed regex for operation not allowed error 34 var RxTxEngineClosed = regexp.MustCompile("tx engine can't accept new connections in state (NotServing|Transitioning)") 35 36 // WrongTablet for invalid tablet type error 37 const WrongTablet = "wrong tablet type" 38 39 // RxWrongTablet regex for invalid tablet type error 40 var RxWrongTablet = regexp.MustCompile("(wrong|invalid) tablet type") 41 42 // Constants for error messages 43 const ( 44 // PrimaryVindexNotSet is the error message to be used when there is no primary vindex found on a table 45 PrimaryVindexNotSet = "table '%s' does not have a primary vindex" 46 )