mirror of
https://github.com/Xevion/scla-unsubscribe.git
synced 2025-12-06 09:16:21 -06:00
28 lines
640 B
Go
28 lines
640 B
Go
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", []byte(e[:]))
|
|
}
|
|
|
|
func (e ChecksumInvalidError) Error() string {
|
|
return fmt.Sprintf("checksum invalid: %x", []byte(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])
|
|
}
|