diff options
author | Runxi Yu <me@runxiyu.org> | 2025-08-12 11:01:07 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-09-15 15:19:12 +0800 |
commit | eb82fdb2dc0903e6125014abd64aceab42c8eb35 (patch) | |
tree | c07276ba1595c415ebc28943163d88f3e3180254 /forged/internal/common/bare/errors.go | |
parent | Remove forge-specific functions from misc (diff) | |
download | forge-eb82fdb2dc0903e6125014abd64aceab42c8eb35.tar.gz forge-eb82fdb2dc0903e6125014abd64aceab42c8eb35.tar.zst forge-eb82fdb2dc0903e6125014abd64aceab42c8eb35.zip |
Diffstat (limited to 'forged/internal/common/bare/errors.go')
-rw-r--r-- | forged/internal/common/bare/errors.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/forged/internal/common/bare/errors.go b/forged/internal/common/bare/errors.go new file mode 100644 index 0000000..4634f0c --- /dev/null +++ b/forged/internal/common/bare/errors.go @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright (c) 2025 Drew Devault <https://drewdevault.com> + +package bare + +import ( + "errors" + "fmt" + "reflect" +) + +var ErrInvalidStr = errors.New("string contains invalid UTF-8 sequences") + +type UnsupportedTypeError struct { + Type reflect.Type +} + +func (e *UnsupportedTypeError) Error() string { + return fmt.Sprintf("unsupported type for marshaling: %s\n", e.Type.String()) +} |