Skip to content

Commit 7a2d780

Browse files
committed
add new known errors
1 parent 3c1e35e commit 7a2d780

4 files changed

Lines changed: 25 additions & 6 deletions

File tree

pkg/db/errors.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,27 @@ import (
1313
var KnownErrors = map[string]string{
1414
"i/o timeout": models.NetErrorIoTimeout,
1515
"RPC timeout": models.NetErrorIoTimeout,
16-
"no recent network activity": models.NetErrorNoRecentNetworkActivity,
16+
"no recent network activity": models.NetErrorIoTimeout, // formerly NetErrorNoRecentNetworkActivity (equivalent to a timeout)
1717
"connection refused": models.NetErrorConnectionRefused,
1818
"connection reset by peer": models.NetErrorConnectionResetByPeer,
1919
"protocol not supported": models.NetErrorProtocolNotSupported,
20+
"protocols not supported": models.NetErrorProtocolNotSupported,
2021
"peer id mismatch": models.NetErrorPeerIDMismatch,
22+
"peer IDs don't match": models.NetErrorPeerIDMismatch,
2123
"no route to host": models.NetErrorNoRouteToHost,
2224
"network is unreachable": models.NetErrorNetworkUnreachable,
2325
"no good addresses": models.NetErrorNoGoodAddresses,
2426
"context deadline exceeded": models.NetErrorIoTimeout, // formerly NetErrorContextDeadlineExceeded
25-
"no public IP address": models.NetErrorNoPublicIP,
27+
"no public IP address": models.NetErrorNoIPAddress,
2628
"max dial attempts exceeded": models.NetErrorMaxDialAttemptsExceeded,
2729
"host is down": models.NetErrorHostIsDown,
2830
"stream reset": models.NetErrorStreamReset,
2931
"failed to negotiate security protocol: EOF": models.NetErrorNegotiateSecurityProtocol, // connect retry logic in discv5 relies on the ": EOF" suffix.
3032
"failed to negotiate stream multiplexer": models.NetErrorNegotiateStreamMultiplexer,
3133
"resource limit exceeded": models.NetErrorResourceLimitExceeded,
3234
"Write on stream": models.NetErrorWriteOnStream,
35+
"can't assign requested address": models.NetErrorCantAssignRequestedAddress, // transient error
36+
"connection gated": models.NetErrorConnectionGated, // transient error
3337
}
3438

3539
var ErrorStr = map[string]string{}
@@ -48,10 +52,14 @@ var knownErrorsPrecedence = []string{
4852
"i/o timeout",
4953
"RPC timeout",
5054
"no recent network activity",
55+
"can't assign requested address",
56+
"connection gated",
5157
"connection refused",
5258
"connection reset by peer",
5359
"protocol not supported",
60+
"protocols not supported",
5461
"peer id mismatch",
62+
"peer IDs don't match",
5563
"no route to host",
5664
"network is unreachable",
5765
"no good addresses",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-- no down migration :/
1+
-- no down migration
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
ALTER TYPE net_error ADD VALUE 'connection_reset_by_peer';
1+
BEGIN;
2+
3+
ALTER TYPE net_error ADD VALUE 'connection_reset_by_peer';
4+
ALTER TYPE net_error ADD VALUE 'cant_assign_requested_address';
5+
ALTER TYPE net_error ADD VALUE 'connection_gated';
6+
ALTER TYPE net_error RENAME VALUE 'no_public_ip' TO 'no_ip_address';
7+
8+
COMMIT

pkg/models/boil_types.go

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)