Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: appengine/logdog/coordinator/backend/util.go

Issue 1910633006: LogDog: Support per-namespace expired archival. (Closed) Base URL: https://github.com/luci/luci-go@logdog-coordinator-svcdec
Patch Set: Update another test. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/logdog/coordinator/backend/doc.go ('k') | appengine/logdog/coordinator/backend/util_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/logdog/coordinator/backend/util.go
diff --git a/appengine/logdog/coordinator/backend/util.go b/appengine/logdog/coordinator/backend/util.go
deleted file mode 100644
index 6d0e33136b7ab1f04ea8248df8fd0c98ff7d28fd..0000000000000000000000000000000000000000
--- a/appengine/logdog/coordinator/backend/util.go
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package backend
-
-import (
- "fmt"
- "net/http"
-
- log "github.com/luci/luci-go/common/logging"
- "golang.org/x/net/context"
-)
-
-// httpError
-type httpError struct {
- reason error
- code int
-}
-
-func (e *httpError) Error() string {
- if r := e.reason; r != nil {
- return fmt.Sprintf("%v: %q", e.reason, http.StatusText(e.code))
- }
- return http.StatusText(e.code)
-}
-
-func newHTTPError(reason error, code int) error {
- return &httpError{reason, code}
-}
-
-// errorWrapper wraps an error-returning function and responds with an
-// InternalServerError if an error is returned.
-func errorWrapper(c context.Context, w http.ResponseWriter, f func() error) {
- if err := f(); err != nil {
- statusCode := http.StatusInternalServerError
- if e, ok := err.(*httpError); ok {
- statusCode = e.code
- }
-
- log.Fields{
- log.ErrorKey: err,
- "statusCode": statusCode,
- }.Errorf(c, "Backend handler returned error.")
- w.WriteHeader(statusCode)
- }
-}
« no previous file with comments | « appengine/logdog/coordinator/backend/doc.go ('k') | appengine/logdog/coordinator/backend/util_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698