Update config error

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2022-01-24 14:42:57 -08:00
parent 65b168aa8b
commit 6be9925127
4 changed files with 26 additions and 3 deletions

View File

@@ -104,6 +104,9 @@ const (
// JSConsumerInvalidSamplingErrF failed to parse consumer sampling configuration: {err}
JSConsumerInvalidSamplingErrF ErrorIdentifier = 10095
// JSConsumerMaxDeliverBackoffErr max deliver is required to be > length of backoff values
JSConsumerMaxDeliverBackoffErr ErrorIdentifier = 10116
// JSConsumerMaxPendingAckPolicyRequiredErr consumer requires ack policy for max ack pending
JSConsumerMaxPendingAckPolicyRequiredErr ErrorIdentifier = 10082
@@ -383,6 +386,7 @@ var (
JSConsumerInvalidDeliverSubject: {Code: 400, ErrCode: 10112, Description: "invalid push consumer deliver subject"},
JSConsumerInvalidPolicyErrF: {Code: 400, ErrCode: 10094, Description: "{err}"},
JSConsumerInvalidSamplingErrF: {Code: 400, ErrCode: 10095, Description: "failed to parse consumer sampling configuration: {err}"},
JSConsumerMaxDeliverBackoffErr: {Code: 400, ErrCode: 10116, Description: "max deliver is required to be > length of backoff values"},
JSConsumerMaxPendingAckPolicyRequiredErr: {Code: 400, ErrCode: 10082, Description: "consumer requires ack policy for max ack pending"},
JSConsumerMaxRequestBatchNegativeErr: {Code: 400, ErrCode: 10114, Description: "consumer max request batch needs to be > 0"},
JSConsumerMaxRequestExpiresToSmall: {Code: 400, ErrCode: 10115, Description: "consumer max request expires needs to be >= 1ms"},
@@ -843,6 +847,16 @@ func NewJSConsumerInvalidSamplingError(err error, opts ...ErrorOption) *ApiError
}
}
// NewJSConsumerMaxDeliverBackoffError creates a new JSConsumerMaxDeliverBackoffErr error: "max deliver is required to be > length of backoff values"
func NewJSConsumerMaxDeliverBackoffError(opts ...ErrorOption) *ApiError {
eopts := parseOpts(opts)
if ae, ok := eopts.err.(*ApiError); ok {
return ae
}
return ApiErrors[JSConsumerMaxDeliverBackoffErr]
}
// NewJSConsumerMaxPendingAckPolicyRequiredError creates a new JSConsumerMaxPendingAckPolicyRequiredErr error: "consumer requires ack policy for max ack pending"
func NewJSConsumerMaxPendingAckPolicyRequiredError(opts ...ErrorOption) *ApiError {
eopts := parseOpts(opts)