Skip to content

Commit fcbc626

Browse files
committed
⬆️ improvement: add more helpful error messages in unsupported relation types
1 parent 7404e79 commit fcbc626

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/generators/relations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function stringifyRelationsInputCreate(
124124
typeboxIdType = "Integer";
125125
break;
126126
default:
127-
throw new Error("Unsupported id type");
127+
throw new Error(`Unsupported ID type: ${field.type} on model ${data.name} in relation ${field.name}`);
128128
}
129129

130130
let connectString = `${getConfig().typeboxImportVariableName}.Object({
@@ -215,7 +215,7 @@ export function stringifyRelationsInputUpdate(
215215
typeboxIdType = "Integer";
216216
break;
217217
default:
218-
throw new Error("Unsupported id type");
218+
throw new Error(`Unsupported ID type: ${field.type} on model ${data.name} in relation ${field.name}`);
219219
}
220220

221221
let stringifiedType: string;

0 commit comments

Comments
 (0)