Problem
When trying to load proto files, if the path is not found, grpc dies in a non-obvious way:
TypeError: Cannot read property 'ns' of null
at Object.load (node_modules/grpc/index.js:146:28)
at loadRpcService (node_modules/@communityco/platform-helpers/lib/service/utils/grpc.js:42:22)
at createRpcClient (node_modules/@communityco/platform-helpers/lib/service/utils/grpc.js:60:19)
at createClient (node_modules/@communityco/platform-helpers/lib/service/index.js:55:22)
at Context.before (test/profiles.component.test.js:58:14)
Synopsis
This is due to some fault intolerant code when making an internal builder object:
|
return loadObject(builder.ns, options); |
try {
switch(format) {
case 'proto':
builder = ProtoBuf.loadProtoFile(filename);
break;
case 'json':
builder = ProtoBuf.loadJsonFile(filename);
break;
default:
throw new Error('Unrecognized format "' + format + '"');
}
} finally {
ProtoBuf.convertFieldsToCamelCase = convertFieldsToCamelCaseOriginal;
}
return loadObject(builder.ns, options);
Expected Behavior
In the case in which a file cannot be found, throw an exception indicating so.
Simple fix, PR WIP.
Problem
When trying to load proto files, if the path is not found, grpc dies in a non-obvious way:
Synopsis
This is due to some fault intolerant code when making an internal builder object:
grpc-node/packages/grpc-native-core/index.js
Line 146 in 0e10540
Expected Behavior
In the case in which a file cannot be found, throw an exception indicating so.
Simple fix, PR WIP.