matrix-react-sdk
Version:
SDK for matrix.org using React
29 lines (28 loc) • 1.12 kB
TypeScript
import React from "react";
/**
* Get a user friendly error message string from a given error. Useful for the
* `description` prop of the `ErrorDialog`
* @param err Error object in question to extract a useful message from. To make it easy
* to use with try/catch, this is typed as `any` because try/catch will type
* the error as `unknown`. And in any case we can use the fallback message.
* @param translatedFallbackMessage The fallback message to be used if the error doesn't have any message
* @returns a user friendly error message string from a given error
*/
export declare function extractErrorMessageFromError(err: any, translatedFallbackMessage: string): string;
interface IProps {
onFinished: (success?: boolean) => void;
title?: string;
description?: React.ReactNode;
button?: string;
focus?: boolean;
headerImage?: string;
}
interface IState {
onFinished: (success: boolean) => void;
}
export default class ErrorDialog extends React.Component<IProps, IState> {
static defaultProps: Partial<IProps>;
private onClick;
render(): React.ReactNode;
}
export {};