()
| 629 | } |
| 630 | |
| 631 | public loadProto(): any { |
| 632 | try { |
| 633 | const packageDefinition = getGrpcPackageDefinition( |
| 634 | this.options, |
| 635 | grpcProtoLoaderPackage, |
| 636 | ); |
| 637 | |
| 638 | if (this.options.onLoadPackageDefinition) { |
| 639 | this.options.onLoadPackageDefinition( |
| 640 | packageDefinition, |
| 641 | this.grpcClient, |
| 642 | ); |
| 643 | } |
| 644 | |
| 645 | return grpcPackage.loadPackageDefinition(packageDefinition); |
| 646 | } catch (err) { |
| 647 | const invalidProtoError = new InvalidProtoDefinitionException(err.path); |
| 648 | const message = |
| 649 | err && err.message ? err.message : invalidProtoError.message; |
| 650 | |
| 651 | this.logger.error(message, invalidProtoError.stack); |
| 652 | throw invalidProtoError; |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | /** |
| 657 | * Recursively fetch all of the service methods available on loaded |
no test coverage detected