Skip to content

Commit f39e35c

Browse files
committed
coderabbit comments
1 parent b581e2d commit f39e35c

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

apps/roam/src/components/CreateRelationDialog.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ const CreateRelationDialog = ({
9494
// should not happen at this point, since the pattern was vetted at input.
9595
internalError({
9696
type: "create-relation-error",
97-
error:
98-
"Create Relation dialog: Could not find identify node downstream",
97+
error: "Create Relation dialog: Could not identify node downstream",
9998
});
10099
return null;
101100
}
@@ -275,7 +274,7 @@ const prepareRelData = (
275274
if (!nodeSchema) {
276275
// should not happen at this point, since the pattern was vetted at input.
277276
internalError({
278-
error: "Create Relation dialog: Could not find identify node downstream",
277+
error: "Create Relation dialog: Could not identify node downstream",
279278
type: "create-relation-error",
280279
});
281280
return [];

apps/roam/src/components/canvas/useRoamStore.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ export const useRoamStore = ({
136136

137137
const handleStoreError = ({
138138
error,
139-
errorMessage,
139+
type,
140140
}: {
141141
error: Error;
142-
errorMessage: string;
142+
type: string;
143143
}): void => {
144144
setError(error);
145145
setLoading(false);
@@ -148,7 +148,7 @@ export const useRoamStore = ({
148148
: 0;
149149
internalError({
150150
error,
151-
type: "roam-store-error",
151+
type,
152152
context: {
153153
pageUid,
154154
snapshotSize,
@@ -169,7 +169,7 @@ export const useRoamStore = ({
169169
} catch (e) {
170170
handleStoreError({
171171
error: e as Error,
172-
errorMessage: "Failed to create TLStore",
172+
type: "tlstore-creation-failure",
173173
});
174174
return null;
175175
}
@@ -180,7 +180,7 @@ export const useRoamStore = ({
180180
} catch (e) {
181181
handleStoreError({
182182
error: e as Error,
183-
errorMessage: "Failed to migrate snapshot",
183+
type: "snapshot-migration-failure",
184184
});
185185
return null;
186186
}

apps/roam/src/utils/internalError.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const internalError = ({
1414
type?: string;
1515
userMessage?: string;
1616
context?: Properties;
17-
}) => {
17+
}): void => {
1818
if (process.env.NODE_ENV === "development") {
1919
console.error(error, context);
2020
} else {

0 commit comments

Comments
 (0)