import { createOdspNetworkError } from "@fluidframework/odsp-doclib-utils" ; import { IOdspSocketError } from "./contracts" ; /**
 * Returns network error based on error object from ODSP socket (IOdspSocketError)
 */ export function errorObjectFromSocketError ( socketError , handler ) { const message = `OdspSocketError (${ handler }): ${ socketError . message }` ; const error = createOdspNetworkError ( `odspSocketError [${ handler }]` , message , socketError . code , socketError . retryAfter ) ; error . addTelemetryProperties ( { odspError : true , relayServiceError : true } ) ; return error ; }