Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/roam/src/utils/sendErrorEmail.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getNodeEnv } from "roamjs-components/util/env";
import { ErrorEmailProps } from "@repo/types";
import { getVersionWithDate } from "~/utils/getVersion";

const sendErrorEmail = async ({
error,
Expand All @@ -14,12 +15,15 @@ const sendErrorEmail = async ({
getNodeEnv() === "development"
? "http://localhost:3000/api/errors"
: "https://discoursegraphs.com/api/errors";
const { version, buildDate } = getVersionWithDate();
const payload: ErrorEmailProps = {
errorMessage: error.message,
errorStack: error.stack || "",
type,
app: "Roam",
graphName: window.roamAlphaAPI?.graph?.name || "unknown",
version,
buildDate,
context,
};

Expand Down
10 changes: 7 additions & 3 deletions apps/website/app/api/errors/EmailTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ export const EmailTemplate = ({
type,
app,
graphName,
version,
buildDate,
context,
}: ErrorEmailProps) => {
return (
<div>
<h1>Error Report</h1>

<h2>Type: {type}</h2>
<h2>App: {app}</h2>
<h2>Graph Name: {graphName}</h2>
<span>Type: {type}</span>
<span>App: {app}</span>
<span>Graph Name: {graphName}</span>
{version && <span>Version: {version}</span>}
{buildDate && <span>Build Date: {buildDate}</span>}

<div>
<h2>Error Details</h2>
Expand Down
2 changes: 2 additions & 0 deletions packages/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ export type ErrorEmailProps = {
type: string; // To identify the type of error, eg "Export Dialog Failed"
app: "Roam" | "Obsidian";
graphName: string;
version?: string;
buildDate?: string;
context?: Record<string, unknown>;
};