mirror of
https://github.com/Xevion/scla-unsubscribe.git
synced 2025-12-06 03:16:23 -06:00
Setup errors
This commit is contained in:
26
errors.go
26
errors.go
@@ -1 +1,27 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
type ChecksumMissingError [32]byte
|
||||
type ChecksumInvalidError [32]byte
|
||||
type UnsubscribeRejectedError string
|
||||
type UnsubscribeUnexpectedError struct {
|
||||
Message string
|
||||
Code int
|
||||
}
|
||||
|
||||
func (e ChecksumMissingError) Error() string {
|
||||
return fmt.Sprintf("checksum missing: %x", e)
|
||||
}
|
||||
|
||||
func (e ChecksumInvalidError) Error() string {
|
||||
return fmt.Sprintf("checksum invalid: %x", e)
|
||||
}
|
||||
|
||||
func (e UnsubscribeRejectedError) Error() string {
|
||||
return fmt.Sprintf("rejected: %s", string(e))
|
||||
}
|
||||
|
||||
func (e UnsubscribeUnexpectedError) Error() string {
|
||||
return fmt.Sprintf("unexpected error: %s", e.Message[:50])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user