When the remote peer does not support ssb-ebt RPCs, it gets a networkError that looks like this:
ssb-js
rpc.ebt.replicate exception: {
message: 'method:ebt,replicate is not in list of allowed methods',
name: 'Error',
stack: 'Error: method:ebt,replicate is not in list of allowed methods\n' +
' at Function.perms.pre (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/permissions.js:88:14)\n' +
...
...
go-ssb
rpc.ebt.replicate exception: {
name: 'Error',
message: 'muxrpc: no such command: ebt.replicate',
stack: ''
}
When the remote peer does not support ssb-ebt RPCs, it gets a
networkError
that looks like this:ssb-js
go-ssb
In this line https://github.com/ssbc/ssb-ebt/blob/b9a7f8b097d41c7f7b33eef9167e517953e06923/index.js#L110 we could treat those two special cases, by picking
networkError.message
and checking if the message matches, and if it does, we could print a more human readable message toconsole.warn
like this:In the other cases, we just pass the
networkError
down todetectSeverity