aboutsummaryrefslogtreecommitdiff
path: root/web/bsky/package.go
blob: ed43b46e40ace89ea8ffd3db4f63ab87e00491e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package bsky

import (
	"fmt"
	"log/slog"
)

type Error struct {
	ErrorKind string `json:"error"`
	Message   string `json:"message"`
}

func (e Error) Error() string {
	return fmt.Sprintf("bsky: %s: %s", e.ErrorKind, e.Message)
}

func (e Error) LogValue() slog.Value {
	return slog.GroupValue(
		slog.String("error", e.ErrorKind),
		slog.String("msg", e.Message),
	)
}