@linkedmink/node-route53-dynamic-dns
Version:
Background process that updates AWS Route 53 DNS address records whenever the public IP of the hosting environment changes
16 lines (14 loc) • 496 B
text/typescript
import { isNativeError } from "node:util/types";
import { isStringConvertable } from "./type-check.mjs";
export const formatError = (error: unknown): string => {
if (isNativeError(error)) {
return error.stack ? error.stack : error.message;
} else if (typeof error === "string") {
return error;
} else if (isStringConvertable(error)) {
return error.toString();
} else {
const stack = new Error().stack as string;
return `Unspecified Unhandled Error: ${stack}`;
}
};