Rightly or not, I didn't expect console logs from the production release of DashJS. Instead, I expected all errors to just be throw
n, allowing the consumer of the library to choose how to handle them.
Failed to get dataContract { Error: 14 UNAVAILABLE: failed to connect to all addresses
at Object.exports.createStatusError (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/common.js:91:15)
at Object.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:1209:28)
at InterceptingListener._callNext (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:568:42)
at InterceptingListener.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:618:8)
at InterceptingListener._callNext (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:574:12)
at InterceptingListener.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:618:8)
at callback (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:847:24)
code: 14,
metadata: Metadata { _internal_repr: {}, flags: 0 },
details: 'failed to connect to all addresses' }
SDK apps fetching : failed to init { Error: 14 UNAVAILABLE: failed to connect to all addresses
at Object.exports.createStatusError (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/common.js:91:15)
at Object.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:1209:28)
at InterceptingListener._callNext (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:568:42)
at InterceptingListener.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:618:8)
at InterceptingListener._callNext (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:574:12)
at InterceptingListener.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:618:8)
at callback (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:847:24)
code: 14,
metadata: Metadata { _internal_repr: {}, flags: 0 },
details: 'failed to connect to all addresses' }
(node:25756) UnhandledPromiseRejectionWarning: Error: 14 UNAVAILABLE: failed to connect to all addresses
at Object.exports.createStatusError (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/common.js:91:15)
at Object.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:1209:28)
at InterceptingListener._callNext (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:568:42)
at InterceptingListener.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:618:8)
at InterceptingListener._callNext (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:574:12)
at InterceptingListener.onReceiveStatus (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:618:8)
at callback (/Users/Rion/code/dash/playground/basic-ts/node_modules/grpc/src/client_interceptors.js:847:24)
(node:25756) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:25756) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
error: Error fetching UTXO yXZHE87HnZzM9RdE29A9k4ChtNXnxsBH1b,yPywTqhYdTShcVGjdUvZ7oEVrDtLMuvmHd,yZy99o1pA5rLeJUAW8KTn9L7orb4ENUgoD,yhbgMHneshPk9AGkFKNuRXL9LEWzzoyAn7,yZqgZBEQx7LWW86hbrpHRjTsWKGJQMmXmt,yPDnxrjVXZXPXYp93huz8gj54wBvVnj16W,yaacFqcTTjzqfmzhE8TCTjpDfxB1VvrpqZ,ySfb5jSAyJgLaNL59dHmYhYGDcFa22ZMYw,ycHJ3cwn9UqdsqEBmJjU1PvGjX5WfPkVgV,yb97wbMADJ6xNu47dXpn5z9MQsmxxTEcf2,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ygwF4LkjBY79YBHUxKpJBuiSd33P6s48bk:{_from}:{_to} - connect ETIMEDOUT 159.89.8.31:3000
(node:25756) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 159.89.8.31:3000
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
(node:25756) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
error: Error fetching UTXO yXZHE87HnZzM9RdE29A9k4ChtNXnxsBH1b,yPywTqhYdTShcVGjdUvZ7oEVrDtLMuvmHd,yZy99o1pA5rLeJUAW8KTn9L7orb4ENUgoD,yhbgMHneshPk9AGkFKNuRXL9LEWzzoyAn7,yZqgZBEQx7LWW86hbrpHRjTsWKGJQMmXmt,yPDnxrjVXZXPXYp93huz8gj54wBvVnj16W,yaacFqcTTjzqfmzhE8TCTjpDfxB1VvrpqZ,ySfb5jSAyJgLaNL59dHmYhYGDcFa22ZMYw,ycHJ3cwn9UqdsqEBmJjU1PvGjX5WfPkVgV,yb97wbMADJ6xNu47dXpn5z9MQsmxxTEcf2,yULX46SvfWs9oVBBiRU8poCya1X55EoUqT,yYRMM4jpwrygyLC53B9XH4EuUPPUoTpy6f,ybVYawJ4XCvA6EDgiSyGkXBq6qN5VSVXvb,yR1qxxgtZFPnsvyjJkdzkZZkNf1BuJKYHu,yiiPLJbLppSf6EixjrcCMd4ZefZcvEfJcb,yahrxZx5aYsyDbypMiAbmPFV43XfoVBfBJ,yXVuuMPbw6snFrTgKbRZipg9UGNYnpKXrK,ybsX3WTYpbTgqbUavsiAd7WLCDSMNxzJib,yZa6ejoJWvr2oUqj4QQfJBKctZxf7aR98t,yfVR4Pwxbp2LUpmJ64A36GGe6Bs5ivfc9m,yMZvb8zaTtWwRqSLHNdXSE9CjhtTTZSpEx,yPer3w7GwWTwVbd2M5gwZbREsrndrjC4ju,yPkZFARXSXU8XPum5o6Mk81dvzvWERd7PF,yMjyCvtAQxxFJVWGTVUknT2umTKWLxoHPt,yPkxnnztuhhYyYT6zXkUmvASKPWXn191vr,yMxRiDUDPqp51D9eTAtSPpCtJrqcB7p5Mg,yNyC1poPe45FTkmtqTARekKkyYDEG8FPZD,ygAPvEiexcD3LrXXUUwUTk6BrDswJDz6JP,yYN7vnouqqiNnWYZJZsvxAcUUGoxYqAh1d,yierSZ7DzRjLyjP8WN5NLoziwCxCUCtV39,yQWUynQhD2PHRWzgUN45rKRdYkNkBhUK38,yWZqHvAJLp77fdApxCpRTn7fz1V8EuMhvn,yMp8yTcVsLGWmfRwwPDyDtdKqwCqQRgrZe,yhArTHM1Zge816QVeq9qTZVEjtT4HaSDGf,yZdgtKRTDVg9B9zzXr4FsET9pTtmC69kDk,yUFZCSEwQdZciXHpLYmc2B3VjmFCv6uYGk,ychK67wjRkoTNaVm7tV4jF3bXAifRfrNVA,yZF2yumqwL1oLK64VyKau1v7d7q54YS2Md,yNuRJoysLAiAp8rueyHX1pf7n6iYriXYec,yLPG4U83w4Ete45EJJwsEe5x6tJeMcoEj8,ySwfbguagCc8vYpsTbEmS6rDf9Yo2jiMKZ,ygwF4LkjBY79YBHUxKpJBuiSd33P6s48bk:{_from}:{_to} - connect ETIMEDOUT 159.89.8.31:3000
(node:25756) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 159.89.8.31:3000
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
(node:25756) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 5)
(node:25756) UnhandledPromiseRejectionWarning: Error: connect ETIMEDOUT 159.89.8.31:3000
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
(node:25756) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 7)
error: Error fetching UTXO yXZHE87HnZzM9RdE29A9k4ChtNXnxsBH1b,yPywTqhYdTShcVGjdUvZ7oEVrDtLMuvmHd,yZy99o1pA5rLeJUAW8KTn9L7orb4ENUgoD,yhbgMHneshPk9AGkFKNuRXL9LEWzzoyAn7,yZqgZBEQx7LWW86hbrpHR...
... (keeps adding "error: Error fetching UTXO"s and uncaught promise rejection warnings)
I'm also wondering if the rationale for logging errors in addition to throwing them might be to see something more than a stack trace full of grpc references, which leaves out relevant detail of where the error(s) originate.
Personally I prefer not to have errors logged in libraries; I'd rather have them thrown for me to catch and handle. The UnhandledPromiseRejectionWarning
s made me think there was something wrong with my code for a long time, and I'm wondering if maybe that's not the case after all.