@kayahr/ed-journal
Version:
Typescript library to read/watch the player journal of Frontier's game Elite Dangerous
17 lines (16 loc) • 696 B
TypeScript
/**
* Returns the error message for the given error. When error is of type Error then the message property is read.
* Otherwise the error is simply converted to a string.
*
* @param error - The error.
* @returns The error message.
*/
export declare function getErrorMessage(error: unknown): string;
/**
* Converts the given error object into an instance of the Error class. If it is already is an instance then it is returned unchanged. Otherwise it
* is converted into a string and a new Error object is created using this string as error message.
*
* @param error - The error if unknown type.
* @returns An Error instance.
*/
export declare function toError(error: unknown): Error;