UNPKG

apphouse

Version:

Component library for React that uses observable state management and theme-able components.

12 lines (11 loc) 290 B
/** * Helper function to get a string representation of an error. * @param error unknown * @returns a string representation of the error */ export function getErrorMessage(error: unknown): string { if (error instanceof Error) { return error.message; } return String(error); }