github.com/saymoon/flop@v0.1.6-0.20201205092451-00912199cc96/error.go (about) 1 package flop 2 3 import "github.com/pkg/errors" 4 5 var ( 6 // ErrFileNotExist occurs when a file is given that does not exist when its existence is required. 7 ErrFileNotExist = errors.New("no such file or directory") 8 // ErrCannotOpenSrc occurs when a src file cannot be opened with os.Open(). 9 ErrCannotOpenSrc = errors.New("source file cannot be opened") 10 // ErrCannotStatFile occurs when a file receives an error from get os.Stat(). 11 ErrCannotStatFile = errors.New("cannot stat file, check that file path is accessible") 12 // ErrCannotChmodFile occurs when an error is received trying to change permissions on a file. 13 ErrCannotChmodFile = errors.New("cannot change permissions on file") 14 // ErrCannotCreateTmpFile occurs when an error is received attempting to create a temporary file for atomic copy. 15 ErrCannotCreateTmpFile = errors.New("temp file cannot be created") 16 // ErrCannotOpenOrCreateDstFile occurs when an error is received attempting to open or create destination file during non-atomic copy. 17 ErrCannotOpenOrCreateDstFile = errors.New("destination file cannot be created") 18 // ErrCannotRenameTempFile occurs when an error is received trying to rename the temporary copy file to the destination. 19 ErrCannotRenameTempFile = errors.New("cannot rename temp file, check file or directory permissions") 20 // ErrOmittingDir occurs when attempting to copy a directory but Options.Recursive is not set to true. 21 ErrOmittingDir = errors.New("Options.Recursive is not true, omitting directory") 22 // ErrWithParentsDstMustBeDir occurs when the destination is expected to be an existing directory but is not 23 // present or accessible. 24 ErrWithParentsDstMustBeDir = errors.New("with Options.Parents, the destination must be a directory") 25 // ErrCannotOverwriteNonDir occurs when attempting to copy a directory to a non-directory. 26 ErrCannotOverwriteNonDir = errors.New("cannot overwrite non-directory") 27 // ErrReadingSrcDir occurs when attempting to read contents of the source directory fails 28 ErrReadingSrcDir = errors.New("cannot read source directory, check source directory permissions") 29 // ErrWritingFileToExistingDir occurs when attempting to write a file to an existing directory. 30 // See AppendNameToPath option for a more dynamic approach. 31 ErrWritingFileToExistingDir = errors.New("cannot overwrite existing directory with file") 32 // ErrInvalidBackupControlValue occurs when a control value is given to the Backup option, but the value is invalid. 33 ErrInvalidBackupControlValue = errors.New("invalid backup value, valid values are 'off', 'simple', 'existing', 'numbered'") 34 )