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

Side by Side Diff: appengine/ephelper/errors.go

Issue 1750143003: Remove ephelper and other endpoints code. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « appengine/ephelper/ephelper.go ('k') | appengine/ephelper/middleware.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package ephelper
6
7 import (
8 "github.com/GoogleCloudPlatform/go-endpoints/endpoints"
9 )
10
11 // StripError converts the supplied error into an endpoints.APIError.
12 //
13 // If the error is not already an endpoints.APIError, InternalServerError
14 // will be returned.
15 func StripError(err error) *endpoints.APIError {
16 if err == nil {
17 return nil
18 }
19
20 epErr, ok := err.(*endpoints.APIError)
21 if !ok {
22 epErr = endpoints.InternalServerError.(*endpoints.APIError)
23 }
24 return epErr
25 }
OLDNEW
« no previous file with comments | « appengine/ephelper/ephelper.go ('k') | appengine/ephelper/middleware.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698