@hashgraph/sdk
Version:
3 lines (2 loc) • 599 B
JavaScript
import t from"./GrpcStatus.js";class r extends Error{constructor(t,e){super(`gRPC service failed with: Status: ${t.toString()}, Code: ${t.valueOf()}`),this.status=t,this.nodeAccountId=e,this.name="GrpcServiceError",void 0!==Error.captureStackTrace&&Error.captureStackTrace(this,r)}static _fromResponse(e){if(null!=e.code&&null!=e.details){const s=t._fromValue(e.code),a=new r(s);return a.stack+=`\nCaused by: ${e.stack?e.stack.toString():""}`,a.message+=`: ${e.details}`,a}return e}toString(){return`${this.name}: ${this.message}`}}export{r as default};
//# sourceMappingURL=GrpcServiceError.js.map