github.com/weaviate/weaviate@v1.24.6/entities/backup/errors.go (about) 1 // _ _ 2 // __ _____ __ ___ ___ __ _| |_ ___ 3 // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ 4 // \ V V / __/ (_| |\ V /| | (_| | || __/ 5 // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| 6 // 7 // Copyright © 2016 - 2024 Weaviate B.V. All rights reserved. 8 // 9 // CONTACT: hello@weaviate.io 10 // 11 12 package backup 13 14 type ErrUnprocessable struct { 15 err error 16 } 17 18 func (e ErrUnprocessable) Error() string { 19 return e.err.Error() 20 } 21 22 func NewErrUnprocessable(err error) ErrUnprocessable { 23 return ErrUnprocessable{err} 24 } 25 26 type ErrNotFound struct { 27 err error 28 } 29 30 func (e ErrNotFound) Error() string { 31 if e.err != nil { 32 return e.err.Error() 33 } 34 return "" 35 } 36 37 func NewErrNotFound(err error) ErrNotFound { 38 return ErrNotFound{err} 39 } 40 41 type ErrContextExpired struct { 42 err error 43 } 44 45 func (e ErrContextExpired) Error() string { 46 return e.err.Error() 47 } 48 49 func NewErrContextExpired(err error) ErrContextExpired { 50 return ErrContextExpired{err} 51 } 52 53 type ErrInternal struct { 54 err error 55 } 56 57 func (e ErrInternal) Error() string { 58 return e.err.Error() 59 } 60 61 func NewErrInternal(err error) ErrInternal { 62 return ErrInternal{err} 63 }