File: errors.go

package info (click to toggle)
golang-k8s-sigs-kustomize-api 0.19.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 3,732 kB
  • sloc: makefile: 206; sh: 67
file content (27 lines) | stat: -rw-r--r-- 672 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2022 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0

package localizer

import "fmt"

type ResourceLoadError struct {
	InlineError error
	FileError   error
}

func (rle ResourceLoadError) Error() string {
	return fmt.Sprintf(`when parsing as inline received error: %s
when parsing as filepath received error: %s`, rle.InlineError, rle.FileError)
}

type PathLocalizeError struct {
	Path      string
	FileError error
	RootError error
}

func (ple PathLocalizeError) Error() string {
	return fmt.Sprintf(`could not localize path %q as file: %s; could not localize path %q as directory: %s`,
		ple.Path, ple.FileError, ple.Path, ple.RootError)
}