import { errors } from '@elastic/elasticsearch' ; param error export function getErrorStatusCode ( error ) { if ( error instanceof errors . ResponseError ) { return error . statusCode ! ; } return error . statusCode || error . status ; } param error export function getDetailedErrorMessage ( error ) { if ( error instanceof errors . ResponseError ) { return JSON . stringify ( error . body ) ; } return error . message ; }