import { AppError, AppErrorContext } from '@jupiterone/platform-sdk-errors'; import { NeptuneErrorStatusAttributeValue, NeptuneResponseErrorDetails } from "./queries"; export declare enum NeptuneFailureReason { /** * "ALREADY_EXISTS" will be used if create operation specified a graph * object that already existed. */ ALREADY_EXISTS = "ALREADY_EXISTS", /** * "NOT_FOUND" will be used if target of update operation was not found. */ NOT_FOUND = "NOT_FOUND", /** * "TIMEOUT" if operation did not complete within the expected duration. */ TIMEOUT = "TIMEOUT", /** * "UNEXPECTED_OUTPUT" will be used if the raw response was not in * expected format. */ UNEXPECTED_OUTPUT = "UNEXPECTED_OUTPUT", /** * "BAD_INPUT" error occurs when input fails validation */ BAD_INPUT_INVALID_GRAPH_OBJECT_ID = "BAD_INPUT_INVALID_GRAPH_OBJECT_ID", /** * "BAD_INPUT_ARRAY_NOT_ALLOWED" will be used when trying to set array value * when creating/updating edge. */ BAD_INPUT_ARRAY_NOT_ALLOWED = "BAD_INPUT_ARRAY_NOT_ALLOWED", /** * "RUNTIME_ERROR" error occurs in JavaScript runtime * (e.g. TypeError) */ RUNTIME_ERROR = "RUNTIME_ERROR", /** * "BAD_EDGE" error occurs when the _from_ and/or _to_ * vertex does not exist when creating an edge. */ BAD_EDGE = "BAD_EDGE", /** * "UNKNOWN" will be used if a more specific cause could not be determined. */ UNKNOWN = "UNKNOWN" } export declare type NeptuneFailureDetails = Record; export declare const APP_NEPTUNE_ERROR_NAME = "AppNeptuneError"; export interface NeptuneError extends AppError { failureReason: NeptuneFailureReason; failureDetails: NeptuneFailureDetails; } export declare type PossibleNeptuneError = Partial; export declare type AppNeptuneErrorOptions = Partial & { cause?: Error; failureReason: NeptuneFailureReason; operationName: string; message?: string; retryable?: boolean; numAttempts?: number; maxNumAttempts?: number; failureDetails?: NeptuneFailureDetails; }; export declare type NeptuneBadEdgeFailureDetails = { missingFromVertex: boolean; missingToVertex: boolean; fromVertexId: string; toVertexId: string; }; export declare type NeptuneAlreadyExistsFailureDetails = { currentVersion: number | undefined; providedVersion: number | undefined; label: string | string[] | undefined; }; export declare type NeptuneNotFoundFailureDetails = { staleWrite: boolean; expectedVersion: number | undefined; actualVersion: number | undefined; }; export declare class AppNeptuneError extends AppError implements NeptuneError, NeptuneResponseErrorDetails { readonly failureReason: NeptuneFailureReason; /** * The request ID returned by remote database * (e.g. "e73bf102-2a64-4a6a-b41d-d9fcd92d3129") */ readonly requestId: string | undefined; /** * The response code returned by remote database * (e.g. "ConcurrentModificationException") */ readonly responseErrorCode: string | undefined; /** * A description of the error that was provided by remote database. * * e.g. "'Failed to complete Remove operation for a Vertex due to * conflicting concurrent operations. Please retry. 0 transactions * are currently rolling back.'" */ readonly responseMessage: string | undefined; /** * The numeric status code (e.g. 500) */ readonly responseStatusCode: number | undefined; /** * A collection of name/value attributes associated with the error response. */ readonly responseStatusAttributes: Record | undefined; readonly failureDetails: Record; constructor(context: AppErrorContext, options: AppNeptuneErrorOptions); }