UNPKG

22.3 kBTypeScriptView Raw
1import './errorcontexts';
2import { ErrorContext, KeyValueErrorContext, ViewErrorContext, QueryErrorContext, SearchErrorContext, AnalyticsErrorContext, HttpErrorContext } from './errorcontexts';
3/**
4 * A generic base error that all errors inherit. Exposes the cause and
5 * context of the error to enable easier debugging.
6 *
7 * @category Error Handling
8 */
9export declare class CouchbaseError extends Error {
10 /**
11 * Specifies the underlying cause of this error, if one is available.
12 */
13 cause: Error | undefined;
14 /**
15 * Specifies additional contextual information which is available for this
16 * error. Depending on the service that generated it.
17 */
18 context: KeyValueErrorContext | ViewErrorContext | QueryErrorContext | SearchErrorContext | AnalyticsErrorContext | HttpErrorContext | undefined;
19 constructor(message: string, cause?: Error, context?: ErrorContext);
20}
21/**
22 * Indicates that an operation was performed after a connection was closed.
23 *
24 * @category Error Handling
25 */
26export declare class ConnectionClosedError extends CouchbaseError {
27 constructor();
28}
29/**
30 * Indicates that an operation was performed after the cluster object was explicitly
31 * closed by the user.
32 *
33 * @category Error Handling
34 */
35export declare class ClusterClosedError extends CouchbaseError {
36 constructor();
37}
38/**
39 * Indicates that an cluster-level operation could not be performed as no buckets
40 * were open. This occurs with pre-6.0 clusters which were not able to fetch cluster
41 * topology without knowing the name of a bucket.
42 *
43 * @category Error Handling
44 */
45export declare class NeedOpenBucketError extends CouchbaseError {
46 constructor();
47}
48/**
49 * Indicates that the specific durability level was invalid.
50 *
51 * @category Error Handling
52 */
53export declare class InvalidDurabilityLevel extends CouchbaseError {
54 constructor();
55}
56/**
57 * Indicates that the specific durabilityPersistTo level was invalid.
58 *
59 * @category Error Handling
60 */
61export declare class InvalidDurabilityPersistToLevel extends CouchbaseError {
62 constructor();
63}
64/**
65 * Indicates that the specific durabilityReplicateTo level was invalid.
66 *
67 * @category Error Handling
68 */
69export declare class InvalidDurabilityReplicateToLevel extends CouchbaseError {
70 constructor();
71}
72/**
73 * Indicates that the operation timed out.
74 *
75 * @category Error Handling
76 */
77export declare class TimeoutError extends CouchbaseError {
78 constructor(cause?: Error, context?: ErrorContext);
79}
80/**
81 * Indicates that the request was explicitly cancelled.
82 *
83 * @category Error Handling
84 */
85export declare class RequestCanceledError extends CouchbaseError {
86 constructor(cause?: Error, context?: ErrorContext);
87}
88/**
89 * Indicates that one of the passed arguments was invalid.
90 *
91 * @category Error Handling
92 */
93export declare class InvalidArgumentError extends CouchbaseError {
94 constructor(cause?: Error, context?: ErrorContext);
95}
96/**
97 * Indicates that the operation requires a service which was not available.
98 * For instance, attempting to perform a query without the query service
99 * being enabled.
100 *
101 * @category Error Handling
102 */
103export declare class ServiceNotAvailableError extends CouchbaseError {
104 constructor(cause?: Error, context?: ErrorContext);
105}
106/**
107 * Indicates some form of internal error occured on the server and the
108 * request could not be completed.
109 *
110 * @category Error Handling
111 */
112export declare class InternalServerFailureError extends CouchbaseError {
113 constructor(cause?: Error, context?: ErrorContext);
114}
115/**
116 * Indicates that an error occurred authenticating the user to the cluster.
117 *
118 * @category Error Handling
119 */
120export declare class AuthenticationFailureError extends CouchbaseError {
121 constructor(cause?: Error, context?: ErrorContext);
122}
123/**
124 * Indicates that a temporary failure occured, attempting the same operation
125 * in the future may succeed.
126 *
127 * @category Error Handling
128 */
129export declare class TemporaryFailureError extends CouchbaseError {
130 constructor(cause?: Error, context?: ErrorContext);
131}
132/**
133 * Indicates that a parsing failure occured.
134 *
135 * @category Error Handling
136 */
137export declare class ParsingFailureError extends CouchbaseError {
138 constructor(cause?: Error, context?: ErrorContext);
139}
140/**
141 * Indicates that a CAS mismatch occurred. This means that the document
142 * has changed since the last access and should be fetched again before
143 * attempting to make further changes.
144 *
145 * @category Error Handling
146 */
147export declare class CasMismatchError extends CouchbaseError {
148 constructor(cause?: Error, context?: ErrorContext);
149}
150/**
151 * Indicates that the bucket being referenced does not exist.
152 *
153 * @category Error Handling
154 */
155export declare class BucketNotFoundError extends CouchbaseError {
156 constructor(cause?: Error, context?: ErrorContext);
157}
158/**
159 * Indicates that the collection being referenced does not exist.
160 *
161 * @category Error Handling
162 */
163export declare class CollectionNotFoundError extends CouchbaseError {
164 constructor(cause?: Error, context?: ErrorContext);
165}
166/**
167 * Indicates that there was a failure during encoding.
168 *
169 * @category Error Handling
170 */
171export declare class EncodingFailureError extends CouchbaseError {
172 constructor(cause?: Error, context?: ErrorContext);
173}
174/**
175 * Indicates that there was a failure during decoding.
176 *
177 * @category Error Handling
178 */
179export declare class DecodingFailureError extends CouchbaseError {
180 constructor(cause?: Error, context?: ErrorContext);
181}
182/**
183 * Indicates that an operation which is not supported was executed.
184 *
185 * @category Error Handling
186 */
187export declare class UnsupportedOperationError extends CouchbaseError {
188 constructor(cause?: Error, context?: ErrorContext);
189}
190/**
191 * Indicates that an ambiguous timeout has occured. The outcome of the
192 * operation is unknown, and it is possible that it completed after the
193 * generation of this error.
194 *
195 * @category Error Handling
196 */
197export declare class AmbiguousTimeoutError extends TimeoutError {
198 constructor(cause?: Error, context?: ErrorContext);
199}
200/**
201 * Indicates an unambiguous timeout has occurred. The outcome of the
202 * operation is objective failure and it is known to have not completed.
203 *
204 * @category Error Handling
205 */
206export declare class UnambiguousTimeoutError extends TimeoutError {
207 constructor(cause?: Error, context?: ErrorContext);
208}
209/**
210 * Indicates a feature which is not available was used. This primarily can
211 * occur if you attempt to perform a query when no query services are enabled
212 * on the cluster, or if a newer server feature which is not available in the
213 * connected server version is used.
214 *
215 * @category Error Handling
216 */
217export declare class FeatureNotAvailableError extends CouchbaseError {
218 constructor(cause?: Error, context?: ErrorContext);
219}
220/**
221 * Indicates that the referenced scope does not exist.
222 *
223 * @category Error Handling
224 */
225export declare class ScopeNotFoundError extends CouchbaseError {
226 constructor(cause?: Error, context?: ErrorContext);
227}
228/**
229 * Indicates that the referenced index does not exist.
230 *
231 * @category Error Handling
232 */
233export declare class IndexNotFoundError extends CouchbaseError {
234 constructor(cause?: Error, context?: ErrorContext);
235}
236/**
237 * Indicates that a rate limit was exceeded while attempting to
238 * execute the operation.
239 *
240 * @category Error Handling
241 */
242export declare class RateLimitedError extends CouchbaseError {
243 constructor(cause?: Error, context?: ErrorContext);
244}
245/**
246 * Indicates that a quota limit was exceeded while attempting to
247 * execute the operation.
248 *
249 * @category Error Handling
250 */
251export declare class QuotaLimitedError extends CouchbaseError {
252 constructor(cause?: Error, context?: ErrorContext);
253}
254/**
255 * Indicates that the referenced index already existed, but was expected
256 * to not yet exist for the operation.
257 *
258 * @category Error Handling
259 */
260export declare class IndexExistsError extends CouchbaseError {
261 constructor(cause?: Error, context?: ErrorContext);
262}
263/**
264 * Indicates that the referenced document does not exist.
265 *
266 * @category Error Handling
267 */
268export declare class DocumentNotFoundError extends CouchbaseError {
269 constructor(cause?: Error, context?: ErrorContext);
270}
271/**
272 * Indicates that the referenced document could not be retrieved.
273 *
274 * @category Error Handling
275 */
276export declare class DocumentUnretrievableError extends CouchbaseError {
277 constructor(cause?: Error, context?: ErrorContext);
278}
279/**
280 * Indicates that the referenced document could not be used as it is currently
281 * locked, likely by another actor in the system.
282 *
283 * @category Error Handling
284 */
285export declare class DocumentLockedError extends CouchbaseError {
286 constructor(cause?: Error, context?: ErrorContext);
287}
288/**
289 * Indicates that the referenced document is not locked. Generally raised when an unlock
290 * operation is performed.
291 *
292 * @category Error Handling
293 */
294export declare class DocumentNotLockedError extends CouchbaseError {
295 constructor(cause?: Error, context?: ErrorContext);
296}
297/**
298 * Indicates that a value could not be stored as it was too large.
299 *
300 * @category Error Handling
301 */
302export declare class ValueTooLargeError extends CouchbaseError {
303 constructor(cause?: Error, context?: ErrorContext);
304}
305/**
306 * Indicates that the referenced document exists already, but the operation
307 * was not expecting it to exist.
308 *
309 * @category Error Handling
310 */
311export declare class DocumentExistsError extends CouchbaseError {
312 constructor(cause?: Error, context?: ErrorContext);
313}
314/**
315 * Indicates that a JSON operation was attempted with non-JSON data.
316 *
317 * @category Error Handling
318 */
319export declare class ValueNotJsonError extends CouchbaseError {
320 constructor(cause?: Error, context?: ErrorContext);
321}
322/**
323 * Indicates that a durability level which is not available was specified.
324 *
325 * @category Error Handling
326 */
327export declare class DurabilityLevelNotAvailableError extends CouchbaseError {
328 constructor(cause?: Error, context?: ErrorContext);
329}
330/**
331 * Indicates that a durability level which is impossible to achieve was
332 * specified. This can occur when you try to use Majority but there is
333 * less than the majority of nodes available.
334 *
335 * @category Error Handling
336 */
337export declare class DurabilityImpossibleError extends CouchbaseError {
338 constructor(cause?: Error, context?: ErrorContext);
339}
340/**
341 * Indicates that the durable operation that was performed has failed
342 * ambiguously and may or may not have completed, or may complete in
343 * the future.
344 *
345 * @category Error Handling
346 */
347export declare class DurabilityAmbiguousError extends CouchbaseError {
348 constructor(cause?: Error, context?: ErrorContext);
349}
350/**
351 * Indicates that a write was failed as an existing durable write against
352 * that key is already in progress.
353 *
354 * @category Error Handling
355 */
356export declare class DurableWriteInProgressError extends CouchbaseError {
357 constructor(cause?: Error, context?: ErrorContext);
358}
359/**
360 * Indicates that a write was failed as the server is currently reconstructing
361 * it's durable data following a failover.
362 *
363 * @category Error Handling
364 */
365export declare class DurableWriteReCommitInProgressError extends CouchbaseError {
366 constructor(cause?: Error, context?: ErrorContext);
367}
368/**
369 * Indicates that a mutation was lost.
370 *
371 * @category Error Handling
372 */
373export declare class MutationLostError extends CouchbaseError {
374 constructor(cause?: Error, context?: ErrorContext);
375}
376/**
377 * Indicates that the reference path was not found.
378 *
379 * @category Error Handling
380 */
381export declare class PathNotFoundError extends CouchbaseError {
382 constructor(cause?: Error, context?: ErrorContext);
383}
384/**
385 * Indicates that the referenced path made incorrect assumptions about
386 * the structure of a document, for instance attempting to access a field
387 * as an object when in fact it is an array.
388 *
389 * @category Error Handling
390 */
391export declare class PathMismatchError extends CouchbaseError {
392 constructor(cause?: Error, context?: ErrorContext);
393}
394/**
395 * Indicates that the referenced path is not valid.
396 *
397 * @category Error Handling
398 */
399export declare class PathInvalidError extends CouchbaseError {
400 constructor(cause?: Error, context?: ErrorContext);
401}
402/**
403 * Indicates that the specified path was too large to parse.
404 *
405 * @category Error Handling
406 */
407export declare class PathTooBigError extends CouchbaseError {
408 constructor(cause?: Error, context?: ErrorContext);
409}
410/**
411 * Indicates that the referenced path was too deep to parse.
412 *
413 * @category Error Handling
414 */
415export declare class PathTooDeepError extends CouchbaseError {
416 constructor(cause?: Error, context?: ErrorContext);
417}
418/**
419 * Indicates that the document created by the operation would become
420 * too deep to operate on.
421 *
422 * @category Error Handling
423 */
424export declare class ValueTooDeepError extends CouchbaseError {
425 constructor(cause?: Error, context?: ErrorContext);
426}
427/**
428 * Indicates that the value passed is invalid.
429 *
430 * @category Error Handling
431 */
432export declare class ValueInvalidError extends CouchbaseError {
433 constructor(cause?: Error, context?: ErrorContext);
434}
435/**
436 * Indicates that an operation expecting JSON was performed against a document
437 * which is not JSON.
438 *
439 * @category Error Handling
440 */
441export declare class DocumentNotJsonError extends CouchbaseError {
442 constructor(cause?: Error, context?: ErrorContext);
443}
444/**
445 * Indicates that a number has grown too large.
446 *
447 * @category Error Handling
448 */
449export declare class NumberTooBigError extends CouchbaseError {
450 constructor(cause?: Error, context?: ErrorContext);
451}
452/**
453 * Indicates that the delta specified is invalid.
454 *
455 * @category Error Handling
456 */
457export declare class DeltaInvalidError extends CouchbaseError {
458 constructor(cause?: Error, context?: ErrorContext);
459}
460/**
461 * Indicates that the reference path already existed, but the operation
462 * expected that it did not.
463 *
464 * @category Error Handling
465 */
466export declare class PathExistsError extends CouchbaseError {
467 constructor(cause?: Error, context?: ErrorContext);
468}
469/**
470 * Indicates that a failure occurred while planning a query.
471 *
472 * @category Error Handling
473 */
474export declare class PlanningFailureError extends CouchbaseError {
475 constructor(cause?: Error, context?: ErrorContext);
476}
477/**
478 * Indicates that a failure occured while querying an index.
479 *
480 * @category Error Handling
481 */
482export declare class IndexFailureError extends CouchbaseError {
483 constructor(cause?: Error, context?: ErrorContext);
484}
485/**
486 * Indicates that an error occurred with a prepared statement.
487 *
488 * @category Error Handling
489 */
490export declare class PreparedStatementFailureError extends CouchbaseError {
491 constructor(cause?: Error, context?: ErrorContext);
492}
493/**
494 * Indicates that a generic DML error occurred with a query.
495 *
496 * @category Error Handling
497 */
498export declare class DmlFailureError extends CouchbaseError {
499 constructor(cause?: Error, context?: ErrorContext);
500}
501/**
502 * Indicates that the index was not ready yet.
503 *
504 * @category Error Handling
505 */
506export declare class IndexNotReadyError extends CouchbaseError {
507 constructor(cause?: Error, context?: ErrorContext);
508}
509/**
510 * Indicates that an error occurred while compiling a query.
511 *
512 * @category Error Handling
513 */
514export declare class CompilationFailureError extends CouchbaseError {
515 constructor(cause?: Error, context?: ErrorContext);
516}
517/**
518 * Indicates that the job queue for the service was full and further requests will
519 * be rejected for a period of time until the queue shrinks.
520 *
521 * @category Error Handling
522 */
523export declare class JobQueueFullError extends CouchbaseError {
524 constructor(cause?: Error, context?: ErrorContext);
525}
526/**
527 * Indicates that the referenced dataset does not exist.
528 *
529 * @category Error Handling
530 */
531export declare class DatasetNotFoundError extends CouchbaseError {
532 constructor(cause?: Error, context?: ErrorContext);
533}
534/**
535 * Indicates that the referenced dataverse does not exist.
536 *
537 * @category Error Handling
538 */
539export declare class DataverseNotFoundError extends CouchbaseError {
540 constructor(cause?: Error, context?: ErrorContext);
541}
542/**
543 * Indicates that the referenced dataset already exists, but the operation
544 * expected that it did not.
545 *
546 * @category Error Handling
547 */
548export declare class DatasetExistsError extends CouchbaseError {
549 constructor(cause?: Error, context?: ErrorContext);
550}
551/**
552 * Indicates that the referenced dataverse already exists, but the operation
553 * expected that it did not.
554 *
555 * @category Error Handling
556 */
557export declare class DataverseExistsError extends CouchbaseError {
558 constructor(cause?: Error, context?: ErrorContext);
559}
560/**
561 * Indicates that the referenced link does not exist.
562 *
563 * @category Error Handling
564 */
565export declare class LinkNotFoundError extends CouchbaseError {
566 constructor(cause?: Error, context?: ErrorContext);
567}
568/**
569 * Indicates that the link already exists.
570 *
571 * @category Error Handling
572 */
573export declare class LinkExistsError extends CouchbaseError {
574 constructor(cause?: Error, context?: ErrorContext);
575}
576/**
577 * Indicates that the referenced view does not exist.
578 *
579 * @category Error Handling
580 */
581export declare class ViewNotFoundError extends CouchbaseError {
582 constructor(cause?: Error, context?: ErrorContext);
583}
584/**
585 * Indicates that the referenced design document does not exist.
586 *
587 * @category Error Handling
588 */
589export declare class DesignDocumentNotFoundError extends CouchbaseError {
590 constructor(cause?: Error, context?: ErrorContext);
591}
592/**
593 * Indicates that the referenced collection already exists, but the operation
594 * expected that it did not.
595 *
596 * @category Error Handling
597 */
598export declare class CollectionExistsError extends CouchbaseError {
599 constructor(cause?: Error, context?: ErrorContext);
600}
601/**
602 * Indicates that the referenced scope already exists, but the operation
603 * expected that it did not.
604 *
605 * @category Error Handling
606 */
607export declare class ScopeExistsError extends CouchbaseError {
608 constructor(cause?: Error, context?: ErrorContext);
609}
610/**
611 * Indicates that the referenced user does not exist.
612 *
613 * @category Error Handling
614 */
615export declare class UserNotFoundError extends CouchbaseError {
616 constructor(cause?: Error, context?: ErrorContext);
617}
618/**
619 * Indicates that the referenced group does not exist.
620 *
621 * @category Error Handling
622 */
623export declare class GroupNotFoundError extends CouchbaseError {
624 constructor(cause?: Error, context?: ErrorContext);
625}
626/**
627 * Indicates that the referenced bucket already exists, but the operation
628 * expected it to not exist.
629 *
630 * @category Error Handling
631 */
632export declare class BucketExistsError extends CouchbaseError {
633 constructor(cause?: Error, context?: ErrorContext);
634}
635/**
636 * Indicates that the referenced user already exists, but the operation
637 * expected it to not exist.
638 *
639 * @category Error Handling
640 */
641export declare class UserExistsError extends CouchbaseError {
642 constructor(cause?: Error, context?: ErrorContext);
643}
644/**
645 * Indicates that the bucket could not be flushed due to not having the flush
646 * option enabled. This option can be dynamically adjusted.
647 *
648 * @category Error Handling
649 */
650export declare class BucketNotFlushableError extends CouchbaseError {
651 constructor(cause?: Error, context?: ErrorContext);
652}
653/**
654 * Indicates that the referenced eventing function does not exist.
655 *
656 * @category Error Handling
657 */
658export declare class EventingFunctionNotFoundError extends CouchbaseError {
659 constructor(cause?: Error, context?: ErrorContext);
660}
661/**
662 * Indicates that the referenced eventing function was not deployed but was
663 * expected to have been.
664 *
665 * @category Error Handling
666 */
667export declare class EventingFunctionNotDeployedError extends CouchbaseError {
668 constructor(cause?: Error, context?: ErrorContext);
669}
670/**
671 * Indicates that the eventing function was not able to be compiled.
672 *
673 * @category Error Handling
674 */
675export declare class EventingFunctionCompilationFailureError extends CouchbaseError {
676 constructor(cause?: Error, context?: ErrorContext);
677}
678/**
679 * Indicates that the source and metadata keyspaces both referenced the same
680 * place for an eventing function.
681 *
682 * @category Error Handling
683 */
684export declare class EventingFunctionIdenticalKeyspaceError extends CouchbaseError {
685 constructor(cause?: Error, context?: ErrorContext);
686}
687/**
688 * Indicates that an eventing function was deployed but has not yet fully
689 * completed the bootstrapping process.
690 *
691 * @category Error Handling
692 */
693export declare class EventingFunctionNotBootstrappedError extends CouchbaseError {
694 constructor(cause?: Error, context?: ErrorContext);
695}
696/**
697 * Indicates that an eventing function is deployed but the operation expected
698 * that it was not.
699 *
700 * @category Error Handling
701 */
702export declare class EventingFunctionDeployedError extends CouchbaseError {
703 constructor(cause?: Error, context?: ErrorContext);
704}
705/**
706 * Indicates that an eventing function is paused but the operation expected
707 * that it was not.
708 *
709 * @category Error Handling
710 */
711export declare class EventingFunctionPausedError extends CouchbaseError {
712 constructor(cause?: Error, context?: ErrorContext);
713}
714/**
715 * Indicates a transaction operation failed to complete.
716 *
717 * @category Error Handling
718 */
719export declare class TransactionOperationFailedError extends CouchbaseError {
720 constructor(cause?: Error, context?: ErrorContext);
721}
722/**
723 * Indicates a transaction failed to complete.
724 *
725 * @category Error Handling
726 */
727export declare class TransactionFailedError extends CouchbaseError {
728 constructor(cause?: Error, context?: ErrorContext);
729}
730/**
731 * Indicates a transaction failed to complete due to expiring.
732 *
733 * @category Error Handling
734 */
735export declare class TransactionExpiredError extends CouchbaseError {
736 constructor(cause?: Error);
737}
738/**
739 * Indicates the state of a transaction ended as ambiguous and may or
740 * may not have committed successfully.
741 *
742 * @category Error Handling
743 */
744export declare class TransactionCommitAmbiguousError extends CouchbaseError {
745 constructor(cause?: Error);
746}