@node-lightning/graph
Version:
Lightning Network P2P Graph
30 lines • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeNotFoundError = exports.ChannelNotFoundError = exports.GraphError = exports.GraphErrorCode = void 0;
var GraphErrorCode;
(function (GraphErrorCode) {
GraphErrorCode[GraphErrorCode["ChannelNotFound"] = 1] = "ChannelNotFound";
GraphErrorCode[GraphErrorCode["NodeNotFound"] = 2] = "NodeNotFound";
})(GraphErrorCode = exports.GraphErrorCode || (exports.GraphErrorCode = {}));
class GraphError extends Error {
constructor(code, message) {
super(message);
this.code = code;
}
}
exports.GraphError = GraphError;
class ChannelNotFoundError extends GraphError {
constructor(scid) {
const msg = `channel_not_found ${scid.toString()}`;
super(GraphErrorCode.ChannelNotFound, msg);
}
}
exports.ChannelNotFoundError = ChannelNotFoundError;
class NodeNotFoundError extends GraphError {
constructor(nodeId) {
const msg = `node_not_found ${nodeId.toString()}`;
super(GraphErrorCode.NodeNotFound, msg);
}
}
exports.NodeNotFoundError = NodeNotFoundError;
//# sourceMappingURL=graph-error.js.map