mirror of
https://github.com/supabase/supabase.git
synced 2026-05-09 10:19:50 -04:00
4a0bb36ca8
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
23 lines
702 B
TypeScript
23 lines
702 B
TypeScript
import { ComponentType } from 'react'
|
|
|
|
import { ConnectionTimeoutTroubleshooting } from './errorMappings/ConnectionTimeout'
|
|
import { ConnectionTimeoutError } from '@/types/api-errors'
|
|
import type { ClassifiedError, KnownErrorType } from '@/types/api-errors'
|
|
import type { ResponseError } from '@/types/base'
|
|
|
|
export interface ErrorMapping {
|
|
id: KnownErrorType
|
|
Troubleshooting: ComponentType
|
|
}
|
|
|
|
type ErrorConstructor = new (
|
|
...args: ConstructorParameters<typeof ResponseError>
|
|
) => ClassifiedError
|
|
|
|
export const ERROR_MAPPINGS = new Map<ErrorConstructor, ErrorMapping>([
|
|
[
|
|
ConnectionTimeoutError,
|
|
{ id: 'connection-timeout', Troubleshooting: ConnectionTimeoutTroubleshooting },
|
|
],
|
|
])
|