github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/fs/err.go (about) 1 // Package fs provides mountpath and FQN abstractions and methods to resolve/map stored content 2 /* 3 * Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved. 4 */ 5 package fs 6 7 import ( 8 "fmt" 9 10 "github.com/NVIDIA/aistore/cmn" 11 ) 12 13 const ( 14 SieMpathIDMismatch = (1 + iota) * 10 15 SieTargetIDMismatch 16 SieNotEqVMD 17 SieMetaCorrupted 18 SieFsDiffers 19 SieMpathNotFound 20 ) 21 22 const ( 23 siePrefix = "storage integrity error sie#" 24 ) 25 26 type ( 27 ErrStorageIntegrity struct { 28 Msg string 29 Code int // Sie* enum above 30 } 31 ErrMountpathNoDisks struct { 32 Mi *Mountpath 33 } 34 ) 35 36 func (e *ErrMountpathNoDisks) Error() string { return fmt.Sprintf("%s has no disks", e.Mi) } 37 38 func (sie *ErrStorageIntegrity) Error() string { 39 err := fmt.Errorf(cmn.FmtErrIntegrity, siePrefix, sie.Code, cmn.GitHubHome) 40 return fmt.Sprintf("%v: %s", err, sie.Msg) 41 }