MCPcopy Create free account
hub / github.com/gotenberg/gotenberg / TestSentinelWrappedError_HttpError

Function TestSentinelWrappedError_HttpError

pkg/modules/api/errors_test.go:66–87  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestSentinelWrappedError_HttpError(t *testing.T) {
67 expectStatus, expectMessage := SentinelHttpError{
68 status: http.StatusInternalServerError,
69 message: "foo",
70 }.HttpError()
71
72 actualStatus, actualMessage := sentinelWrappedError{
73 error: errors.New("foo"),
74 sentinel: SentinelHttpError{
75 status: http.StatusInternalServerError,
76 message: "foo",
77 },
78 }.HttpError()
79
80 if actualStatus != expectStatus {
81 t.Errorf("expected %d but got %d", expectStatus, actualStatus)
82 }
83
84 if actualMessage != expectMessage {
85 t.Errorf("expected '%s' but got '%s'", expectMessage, actualMessage)
86 }
87}
88
89func TestWrapError(t *testing.T) {
90 errFoo := errors.New("foo")

Callers

nothing calls this directly

Calls 1

HttpErrorMethod · 0.65

Tested by

no test coverage detected