github.com/nikkelma/oras-project_oras-go@v1.1.1-0.20220201001104-a75f6a419090/pkg/oras/errors.go (about)

     1  /*
     2  Copyright The ORAS Authors.
     3  Licensed under the Apache License, Version 2.0 (the "License");
     4  you may not use this file except in compliance with the License.
     5  You may obtain a copy of the License at
     6  
     7  http://www.apache.org/licenses/LICENSE-2.0
     8  
     9  Unless required by applicable law or agreed to in writing, software
    10  distributed under the License is distributed on an "AS IS" BASIS,
    11  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  See the License for the specific language governing permissions and
    13  limitations under the License.
    14  */
    15  
    16  package oras
    17  
    18  import (
    19  	"errors"
    20  	"fmt"
    21  )
    22  
    23  // Common errors
    24  var (
    25  	ErrResolverUndefined     = errors.New("resolver undefined")
    26  	ErrFromResolverUndefined = errors.New("from target resolver undefined")
    27  	ErrToResolverUndefined   = errors.New("to target resolver undefined")
    28  	ErrFromTargetUndefined   = errors.New("from target undefined")
    29  	ErrToTargetUndefined     = errors.New("from target undefined")
    30  )
    31  
    32  // Path validation related errors
    33  var (
    34  	ErrDirtyPath               = errors.New("dirty path")
    35  	ErrPathNotSlashSeparated   = errors.New("path not slash separated")
    36  	ErrAbsolutePathDisallowed  = errors.New("absolute path disallowed")
    37  	ErrPathTraversalDisallowed = errors.New("path traversal disallowed")
    38  )
    39  
    40  // ErrStopProcessing is used to stop processing an oras operation.
    41  // This error only makes sense in sequential pulling operation.
    42  var ErrStopProcessing = fmt.Errorf("stop processing")