aboutsummaryrefslogtreecommitdiff
path: root/errors
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-04-02 06:23:30 +0000
committerGravatar Runxi Yu2026-04-02 06:28:39 +0000
commita041d523de389b65b98a5373a8034041db2a8d83 (patch)
tree7b423dc735f463be616045f2c3c2095a7737aca7 /errors
parentresearch: Add dynamic pack resources (diff)
signatureNo signature
*: Remove
Diffstat (limited to 'errors')
-rw-r--r--errors/doc.go2
-rw-r--r--errors/missing.go18
-rw-r--r--errors/type.go31
3 files changed, 0 insertions, 51 deletions
diff --git a/errors/doc.go b/errors/doc.go
deleted file mode 100644
index 32afcd10..00000000
--- a/errors/doc.go
+++ /dev/null
@@ -1,2 +0,0 @@
-// Package errors defines error types shared across furgit.
-package errors
diff --git a/errors/missing.go b/errors/missing.go
deleted file mode 100644
index 9efc029a..00000000
--- a/errors/missing.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package errors
-
-import (
- "fmt"
-
- objectid "codeberg.org/lindenii/furgit/object/id"
-)
-
-// ObjectMissingError indicates that a referenced object is absent from the
-// repository object store.
-type ObjectMissingError struct {
- OID objectid.ObjectID
-}
-
-// Error implements error.
-func (e *ObjectMissingError) Error() string {
- return fmt.Sprintf("missing object %s", e.OID)
-}
diff --git a/errors/type.go b/errors/type.go
deleted file mode 100644
index bf3ba110..00000000
--- a/errors/type.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package errors
-
-import (
- "fmt"
-
- objectid "codeberg.org/lindenii/furgit/object/id"
- objecttype "codeberg.org/lindenii/furgit/object/type"
-)
-
-// ObjectTypeError indicates that a referenced object has a different type than
-// what the operation expected.
-type ObjectTypeError struct {
- OID objectid.ObjectID
- Got objecttype.Type
- Want objecttype.Type
-}
-
-// Error implements error.
-func (e *ObjectTypeError) Error() string {
- gotName, gotOK := e.Got.Name()
- if !gotOK {
- gotName = fmt.Sprintf("type(%d)", e.Got)
- }
-
- wantName, wantOK := e.Want.Name()
- if !wantOK {
- wantName = fmt.Sprintf("type(%d)", e.Want)
- }
-
- return fmt.Sprintf("object %s has type %s, want %s", e.OID, gotName, wantName)
-}