export const getErrorMessage = (error: unknown): string => {
  if (error instanceof Error) {
    return error.message
  }
  return String(error)
}

export const getErrorStack = (error: unknown): string | undefined => {
  if (error instanceof Error) {
    return error.stack
  }
  return undefined
}

export const getErrorName = (error: unknown): string => {
  if (error instanceof Error) {
    return error.name
  }
  return "UnknownError"
}
