@twilio-labs/serverless-api
Version:
API-wrapper for the Twilio Serverless API
26 lines (25 loc) • 739 B
TypeScript
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);
}