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

Unified Diff: web/inc/logdog-stream/logdog-error.html

Issue 2335223003: LogDog: Update web code, stream/query with auth. (Closed)
Patch Set: Fix background page loading. Created 4 years, 3 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 | « web/inc/logdog-stream-view/logdog-stream-view.html ('k') | web/inc/logdog-stream/logdog-stream.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: web/inc/logdog-stream/logdog-error.html
diff --git a/web/inc/logdog-stream/logdog-error.html b/web/inc/logdog-stream/logdog-error.html
new file mode 100644
index 0000000000000000000000000000000000000000..924ac2b14057198d15eeae0336c6980cfc753de9
--- /dev/null
+++ b/web/inc/logdog-stream/logdog-error.html
@@ -0,0 +1,32 @@
+<!--
+ Copyright 2016 The LUCI Authors. All rights reserved.
+ Use of this source code is governed under the Apache License, Version 2.0
+ that can be found in the LICENSE file.
+ -->
+
+<link rel="import" href="../rpc/rpc-error.html">
+
+<script>
+ "use strict";
+
+ function LogDogError(base) {
+ this.base = base;
+ };
+ LogDogError.wrapGrpc = function(err) {
+ if (err instanceof luci.rpc.GrpcError) {
+ return new LogDogError(err);
+ }
+ return err;
+ }
+
+ LogDogError.prototype = Object.create(Error.prototype);
+ LogDogError.prototype.isGrpcError = function() {
+ return (this.base.name === "GrpcError");
+ };
+ LogDogError.prototype.isNotFound = function() {
+ return (this.isGrpcError() && this.base.code === 5);
+ };
+ LogDogError.prototype.isPermissionDenied = function() {
+ return (this.isGrpcError() && this.base.code === 7);
+ };
+</script>
« no previous file with comments | « web/inc/logdog-stream-view/logdog-stream-view.html ('k') | web/inc/logdog-stream/logdog-stream.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698