Skip to content

Commit 4b3283f

Browse files
engine: yep, errors should have messages!
1 parent edca125 commit 4b3283f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/xforms-engine/src/instance/children/normalizeChildInitOptions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
} from '@getodk/common/constants/xmlns.ts';
55
import type { GroupDefinition } from '../../client/GroupNode.ts';
66
import type { SubtreeDefinition } from '../../client/SubtreeNode.ts';
7+
import { ErrorProductionDesignPendingError } from '../../error/ErrorProductionDesignPendingError.ts';
78
import { StaticDocument } from '../../integration/xpath/static-dom/StaticDocument.ts';
89
import type { StaticLeafElement } from '../../integration/xpath/static-dom/StaticElement.ts';
910
import { StaticElement } from '../../integration/xpath/static-dom/StaticElement.ts';
@@ -188,7 +189,9 @@ type AssertStaticLeafElement = (element: StaticElement) => asserts element is St
188189

189190
const assertStaticLeafElement: AssertStaticLeafElement = (element) => {
190191
if (!element.isLeafElement()) {
191-
throw new Error();
192+
throw new ErrorProductionDesignPendingError(
193+
`Expected a leaf element, got a non-leaf element at nodeset: ${element.nodeset}`
194+
);
192195
}
193196
};
194197

0 commit comments

Comments
 (0)