import { errors } from '@elastic/elasticsearch' ; export type UnauthorizedError = errors . ResponseError & { statusCode : 401 ; } ; export function isResponseError ( error ) { return error instanceof errors . ResponseError ; } export function isUnauthorizedError ( error ) { return isResponseError ( error ) && error . statusCode === 401 ; }