// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
packagenats
import(
"errors"
"fmt"
)
var(
// API errors
// ErrJetStreamNotEnabled is an error returned when JetStream is not enabled for an account.
//
// Note: This error will not be returned in clustered mode, even if each
// server in the cluster does not have JetStream enabled. In clustered mode,
// requests will time out instead.
ErrJetStreamNotEnabledJetStreamError=&jsError{apiErr:&APIError{ErrorCode:JSErrCodeJetStreamNotEnabled,Description:"jetstream not enabled",Code:503}}
// ErrJetStreamNotEnabledForAccount is an error returned when JetStream is not enabled for an account.
ErrJetStreamNotEnabledForAccountJetStreamError=&jsError{apiErr:&APIError{ErrorCode:JSErrCodeJetStreamNotEnabledForAccount,Description:"jetstream not enabled for account",Code:503}}
// ErrStreamNotFound is an error returned when stream with given name does not exist.
ErrStreamNotFoundJetStreamError=&jsError{apiErr:&APIError{ErrorCode:JSErrCodeStreamNotFound,Description:"stream not found",Code:404}}
// ErrStreamNameAlreadyInUse is returned when a stream with given name already exists and has a different configuration.
ErrStreamNameAlreadyInUseJetStreamError=&jsError{apiErr:&APIError{ErrorCode:JSErrCodeStreamNameInUse,Description:"stream name already in use",Code:400}}
// ErrStreamSubjectTransformNotSupported is returned when the connected nats-server version does not support setting
// the stream subject transform. If this error is returned when executing AddStream(), the stream with invalid
// configuration was already created in the server.
ErrStreamSubjectTransformNotSupportedJetStreamError=&jsError{message:"stream subject transformation not supported by nats-server"}
// ErrStreamSourceSubjectTransformNotSupported is returned when the connected nats-server version does not support setting
// the stream source subject transform. If this error is returned when executing AddStream(), the stream with invalid
// configuration was already created in the server.
ErrStreamSourceSubjectTransformNotSupportedJetStreamError=&jsError{message:"stream subject transformation not supported by nats-server"}
// ErrStreamSourceNotSupported is returned when the connected nats-server version does not support setting
// the stream sources. If this error is returned when executing AddStream(), the stream with invalid
// configuration was already created in the server.
ErrStreamSourceNotSupportedJetStreamError=&jsError{message:"stream sourcing is not supported by nats-server"}
// ErrStreamSourceMultipleSubjectTransformsNotSupported is returned when the connected nats-server version does not support setting
// the stream sources. If this error is returned when executing AddStream(), the stream with invalid
// configuration was already created in the server.
ErrStreamSourceMultipleSubjectTransformsNotSupportedJetStreamError=&jsError{message:"stream sourcing with multiple subject transforms not supported by nats-server"}
// ErrConsumerNotFound is an error returned when consumer with given name does not exist.
ErrConsumerNotFoundJetStreamError=&jsError{apiErr:&APIError{ErrorCode:JSErrCodeConsumerNotFound,Description:"consumer not found",Code:404}}
// ErrMsgNotFound is returned when message with provided sequence number does npt exist.
ErrMsgNotFoundJetStreamError=&jsError{apiErr:&APIError{ErrorCode:JSErrCodeMessageNotFound,Description:"message not found",Code:404}}
// ErrBadRequest is returned when invalid request is sent to JetStream API.
// ErrDuplicateFilterSubjects is returned when both FilterSubject and FilterSubjects are specified when creating consumer.
ErrDuplicateFilterSubjectsJetStreamError=&jsError{apiErr:&APIError{ErrorCode:JSErrCodeDuplicateFilterSubjects,Description:"consumer cannot have both FilterSubject and FilterSubjects specified",Code:500}}
// ErrDuplicateFilterSubjects is returned when filter subjects overlap when creating consumer.
// ErrEmptyFilter is returned when a filter in FilterSubjects is empty.
ErrEmptyFilterJetStreamError=&jsError{apiErr:&APIError{ErrorCode:JSErrCodeConsumerEmptyFilter,Description:"consumer filter in FilterSubjects cannot be empty",Code:500}}
// Client errors
// ErrConsumerNameAlreadyInUse is an error returned when consumer with given name already exists.
ErrConsumerNameAlreadyInUseJetStreamError=&jsError{message:"consumer name already in use"}
// ErrConsumerNotActive is an error returned when consumer is not active.
ErrConsumerNotActiveJetStreamError=&jsError{message:"consumer not active"}
// ErrInvalidJSAck is returned when JetStream ack from message publish is invalid.