doc: document potential errors

This commit is contained in:
fryorcraken.eth 2023-09-20 16:18:22 +10:00
parent a31b6e472e
commit 6807185f3b
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 18 additions and 0 deletions

View File

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