github.com/braveheart12/insolar-09-08-19@v0.8.7/ledger/storage/errors.go (about) 1 /* 2 * Copyright 2019 Insolar Technologies 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 storage 18 19 import ( 20 "errors" 21 22 "github.com/dgraph-io/badger" 23 ) 24 25 var ( 26 // ErrConflictRetriesOver is returned if Update transaction fails on all retry attempts. 27 ErrConflictRetriesOver = errors.New("transaction conflict retries limit exceeded") 28 29 // ErrConflict is the alias for badger.ErrConflict. 30 ErrConflict = badger.ErrConflict 31 32 // ErrOverride is returned if something tries to update existing record. 33 ErrOverride = errors.New("records override is forbidden") 34 35 // ErrClosed is returned when attempt to read or write to closed db. 36 ErrClosed = errors.New("db is closed") 37 38 // ErrPrevPulse is returned if previous pulse not found in storage 39 ErrPrevPulse = errors.New("previous pulse not found") 40 41 // ErrBadPulse is returned when pulse less than latest 42 ErrBadPulse = errors.New("pulse should be bigger than latest") 43 )