UNPKG

@twilio-labs/serverless-api

Version:
26 lines (25 loc) 739 B
export type TwilioApiError = { code: number; message: string; more_info: string; status: number; }; /** * Explictly removes username and password from a URL. * @param unfilteredUrl any URL string */ export declare function filterUrl(unfilteredUrl: string | undefined): string; /** * Throws the error it receives and if it's an HTTP Error it will convert it to a ClientApiError * */ export declare function convertApiErrorsAndThrow(err: any): never; /** * An Error wrapper to provide more useful error information without exposing credentials */ export declare class ClientApiError extends Error { details?: TwilioApiError; code?: number | string; url?: string; constructor(requestError: unknown); }