@@ -59,11 +59,29 @@ export type Callback<T extends IDecodedMessage> = (
59
59
) => void | Promise < void > ;
60
60
61
61
export enum SendError {
62
+ /** Could not determine the origin of the fault. Best to check connectivity and try again */
62
63
GENERIC_FAIL = "Generic error" ,
64
+ /** Failure to protobuf encode the message. This is not recoverable and needs
65
+ * further investigation. */
63
66
ENCODE_FAILED = "Failed to encode" ,
67
+ /** Failure to protobuf decode the message. May be due to a remote peer issue,
68
+ * ensuring that messages are sent via several peer enable mitigation of this error.. */
64
69
DECODE_FAILED = "Failed to decode" ,
70
+ /** The message size is above the maximum message size allowed on the Waku Network.
71
+ * Compressing the message or using an alternative strategy for large messages is recommended.
72
+ */
65
73
SIZE_TOO_BIG = "Size is too big" ,
74
+ /**
75
+ * Failure to find a peer with suitable protocols. This may due to a connection issue.
76
+ * Mitigation can be: retrying after a given time period, display connectivity issue
77
+ * to user or listening for `peer:connected:bootstrap` or `peer:connected:peer-exchange`
78
+ * on the connection manager before retrying.
79
+ */
66
80
NO_PEER_AVAILABLE = "No peer available" ,
81
+ /**
82
+ * The remote peer did not behave as expected. Mitigation from `NO_PEER_AVAILABLE`
83
+ * or `DECODE_FAILED` can be used.
84
+ */
67
85
REMOTE_PEER_FAULT = "Remote peer fault"
68
86
}
69
87
0 commit comments