@keepfy/error-extractor
Advanced tools
Comparing version
import { AllErrorTypes, ApolloErrorWithProps, BackendErrorsWithProperties, ExtractMessageFromError, GraphQLError } from './types'; | ||
import { ErrorResponse } from 'apollo-link-error'; | ||
export declare const fromGraphQLError: (graphQLErrors: GraphQLError[]) => AllErrorTypes; | ||
export declare const fromGraphQLError: (graphQLErrors: readonly GraphQLError[]) => AllErrorTypes; | ||
export declare function isApolloWithProps(error: Error): error is ApolloErrorWithProps; | ||
@@ -5,0 +5,0 @@ export declare const fromApollo: ExtractMessageFromError; |
@@ -1,31 +0,59 @@ | ||
import { GraphQLError, SuggestionsMap } from './types'; | ||
import { SuggestionsMap } from './types'; | ||
export declare const getSuggestion: <T extends import("./types").AllErrorTypes = import("./types").AllErrorTypes>(code: T) => SuggestionsMap[T]; | ||
export declare const suggestionFromGraphQLError: (graphQLErrors: GraphQLError[]) => (import("./types").MessageSuggestion & { | ||
export declare const suggestionFromGraphQLError: (graphQLErrors: readonly any[]) => { | ||
message: any; | ||
type: "SERVICE_OFFLINE"; | ||
}) | (import("./types").MessageSuggestion & { | ||
title: string; | ||
} | { | ||
message: any; | ||
type: "CONNECTION_FAILED"; | ||
}) | (import("./types").MessageSuggestion & { | ||
title: string; | ||
} | { | ||
message: any; | ||
type: "UNKNOWN_ERROR"; | ||
}) | (import("./types").MessageSuggestion & { | ||
title: string; | ||
} | { | ||
message: any; | ||
type: "EMAIL_NOT_CONFIRMED"; | ||
}) | (import("./types").MessageSuggestion & { | ||
title: string; | ||
} | { | ||
message: any; | ||
type: "EMAIL_ALREADY_EXISTS"; | ||
}) | (import("./types").MessageSuggestion & { | ||
title: string; | ||
} | { | ||
message: any; | ||
type: "SCHEMA_UNKNOWN_FIELD"; | ||
}) | (import("./types").MessageSuggestion & { | ||
title: string; | ||
} | { | ||
message: any; | ||
type: "AUTHENTICATION_FAILED"; | ||
}) | (import("./types").MessageSuggestion & { | ||
title: string; | ||
} | { | ||
message: any; | ||
type: "FORBIDDEN"; | ||
}) | (import("./types").MessageSuggestion & { | ||
title: string; | ||
} | { | ||
message: any; | ||
type: "INVALID_SUBSCRIPTION"; | ||
}) | (import("./types").MessageSuggestion & { | ||
title: string; | ||
} | { | ||
message: any; | ||
type: "ENTITY_NOT_FOUND"; | ||
}) | (import("./types").MessageSuggestion & { | ||
title: string; | ||
} | { | ||
message: any; | ||
type: "INVALID_INPUT"; | ||
}) | (import("./types").MessageSuggestion & { | ||
title: string; | ||
} | { | ||
message: any; | ||
type: "INTERNAL_SERVER_ERROR"; | ||
}) | (import("./types").MessageSuggestion & { | ||
title: string; | ||
} | { | ||
message: any; | ||
type: "BUSINESS_ERROR"; | ||
}) | (import("./types").MessageSuggestion & { | ||
title: string; | ||
} | { | ||
message: any; | ||
type: "ENTITY_IS_STILL_REFERENCED"; | ||
}); | ||
title: string; | ||
}; |
@@ -31,10 +31,5 @@ import { ErrorResponse } from 'apollo-link-error'; | ||
}; | ||
export declare type RawGraphQLError = { | ||
code: string; | ||
message: string; | ||
path: string[]; | ||
properties: unknown; | ||
}; | ||
export declare type RawGraphQLError = ApolloError['graphQLErrors'][number]; | ||
export declare type ApolloErrorWithProps = Omit<ApolloError, 'graphQLErrors'> & { | ||
graphQLErrors: Array<RawGraphQLError & { | ||
graphQLErrors: ReadonlyArray<RawGraphQLError & { | ||
properties: unknown; | ||
@@ -41,0 +36,0 @@ }>; |
{ | ||
"name": "@keepfy/error-extractor", | ||
"version": "1.2.5", | ||
"version": "1.2.6", | ||
"description": "An error extractor package for keepfy frontend apps", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
379
6.46%16504
-0.54%