How to use the status function from bindings
Find comprehensive JavaScript bindings.status code examples handpicked from public code repositorys.
GitHub: caryx/Test
257 258 259 260 261 262 263 264 265 266
assert.ifError(err); assert.deepEqual(resp, { send_message: true, client_close: true, status: { code: grpc.status.OK, details: status_text, metadata: {} } });
+ 23 other calls in file
GitHub: caryx/Test
130 131 132 133 134 135 136 137 138 139 140 141
exports.Metadata = Metadata; /** * Status name to code number mapping */ exports.status = grpc.status; /** * Propagate flag name to number mapping */
+ 3 other calls in file
GitHub: caryx/Test
303 304 305 306 307 308 309 310 311 312
response.status.metadata = Metadata._fromCoreRepresentation( response.status.metadata); var status = response.status; var error; var deserialized; if (status.code === grpc.status.OK) { if (err) { // Got a batch error, but OK status. Something went wrong callback(err); return;
+ 44 other calls in file
GitHub: caryx/Test
61 62 63 64 65 66 67 68 69 70
* @param {Object} error The error object */ function handleError(call, error) { var statusMetadata = new Metadata(); var status = { code: grpc.status.UNKNOWN, details: 'Unknown Error' }; if (error.hasOwnProperty('message')) { status.details = error.message;
+ 8 other calls in file
117 118 119 120 121 122 123 124 125 126
it('should time out immediately with negative deadline', function(done) { var call = new grpc.Call(channel, 'method', -Infinity); var batch = {}; batch[grpc.opType.RECV_STATUS_ON_CLIENT] = true; call.startBatch(batch, function(err, response) { assert.strictEqual(response.status.code, grpc.status.DEADLINE_EXCEEDED); done(); }); }); });
+ 4 other calls in file
89 90 91 92 93 94 95 96 97 98
* @return {CallCredentials} The credentials object */ exports.createFromMetadataGenerator = function(metadata_generator) { return CallCredentials.createFromPlugin(function(service_url, callback) { metadata_generator({service_url: service_url}, function(error, metadata) { var code = grpc.status.OK; var message = ''; if (error) { message = error.message; if (error.hasOwnProperty('code')) {
GitHub: springful/grpc
![springful profile picture](/springful.png?size=40)
141 142 143 144 145 146 147 148 149 150
stream.call.startBatch(batch, function(){}); } stream.on('finish', sendStatus); /** * Set the pending status to a given error status. If the error does not have * code or details properties, the code will be set to grpc.status.INTERNAL * and the details will be set to 'Unknown Error'. * @param {Error} err The error object */ function setStatus(err) {
+ 9 other calls in file
bindings.createKey is the most popular function in bindings (8616 examples)