~netlandish/gobwebs

63e060c50e447dff74793ffc3e8ac0d8279cc121 — Peter Sanchez 5 months ago 784ef62
Adding new check for echo context.Canceled relay errors
1 files changed, 3 insertions(+), 2 deletions(-)

M server/server.go
M server/server.go => server/server.go +3 -2
@@ 165,7 165,8 @@ func (c *Context) Error(err error) {
func (s *Server) HTTPErrorHandler(err error, c echo.Context) {
	// TODO: Send to Sentry or some other logger

	if errors.Is(err, context.Canceled) {
	// First check is for echo error relay
	if err.Error() == "context canceled" || errors.Is(err, context.Canceled) {
		s.e.DefaultHTTPErrorHandler(err, c)
	}



@@ 272,7 273,7 @@ func (s *Server) gqlEmailRecover(ctx context.Context, _origErr any) error {
		return fmt.Errorf("internal system error")
	}

	if errors.Is(origErr, context.Canceled) {
	if origErr.Error() == "context canceled" || errors.Is(origErr, context.Canceled) {
		return origErr
	}