Skip to content

Commit 01e65bd

Browse files
Update src/schema-convertors/internalToMongoDB.ts
Co-authored-by: Anna Henningsen <[email protected]>
1 parent 6d4879b commit 01e65bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/schema-convertors/internalToMongoDB.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function parseType(type: SchemaType, signal?: AbortSignal): MongoDBJSONSchema {
5656
}
5757

5858
function parseTypes(types: SchemaType[], signal?: AbortSignal): MongoDBJSONSchema {
59-
if (signal?.aborted) throw new Error('Operation aborted');
59+
if (signal?.aborted) throw signal.reason ?? new Error('Operation aborted');
6060
const definedTypes = types.filter(type => type.bsonType.toLowerCase() !== 'undefined');
6161
const isSingleType = definedTypes.length === 1;
6262
if (isSingleType) {

0 commit comments

Comments
 (0)