MCPcopy Create free account
hub / github.com/bcspragu/logseq-sync / Extract

Function Extract

httperr/httperr.go:8–20  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

6)
7
8func Extract(err error) (int, string) {
9 httpErr, ok := err.(*Error)
10 if !ok {
11 return http.StatusInternalServerError, http.StatusText(http.StatusInternalServerError)
12 }
13
14 msg := httpErr.msg
15 if msg == "" {
16 msg = http.StatusText(httpErr.statusCode)
17 }
18
19 return httpErr.statusCode, msg
20}
21
22type Error struct {
23 err error

Callers 1

handleErrorFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected