| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2016 The LUCI Authors. All rights reserved. | 2 Copyright 2016 The LUCI Authors. All rights reserved. |
| 3 Use of this source code is governed under the Apache License, Version 2.0 | 3 Use of this source code is governed under the Apache License, Version 2.0 |
| 4 that can be found in the LICENSE file. | 4 that can be found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 'use strict'; | 8 'use strict'; |
| 9 | 9 |
| 10 var luci = (function(luci) { | 10 var luci = (function(luci) { |
| 11 | 11 |
| 12 var rpc = luci.rpc = luci.rpc || {}; | 12 var rpc = luci.rpc = luci.rpc || {}; |
| 13 | 13 |
| 14 function GrpcError(code, description) { | 14 function GrpcError(code, description) { |
| 15 if (code == null) { | 15 if (code == null) { |
| 16 throw Error('code is not set') | 16 throw Error('code is not set') |
| 17 } | 17 } |
| 18 this.name = 'GrpcError'; | 18 this.name = 'GrpcError'; |
| 19 this.code = code; | 19 this.code = code; |
| 20 this.description = description; | 20 this.description = description; |
| 21 this.message = 'code = ' + code + ' desc = ' + description; | 21 this.message = 'code = ' + code + ' desc = ' + description; |
| 22 } | 22 } |
| 23 GrpcError.prototype = Error(); | 23 GrpcError.prototype = Error(); |
| 24 rpc.GrpcError = GrpcError; | 24 rpc.GrpcError = GrpcError; |
| 25 | 25 |
| 26 return luci; | 26 return luci; |
| 27 }(luci || {})); | 27 }(luci || {})); |
| 28 </script> | 28 </script> |
| OLD | NEW |