frontend-app-api: use EXTENSION_FACTORY_ERROR for invalid return types

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2025-09-07 13:07:22 +02:00
parent d27c032776
commit 018de42a01
2 changed files with 10 additions and 15 deletions
@@ -1121,8 +1121,9 @@ describe('instantiateAppNodeTree', () => {
),
).toEqual([
{
code: 'EXTENSION_INVALID',
message: 'extension factory did not provide an iterable object',
code: 'EXTENSION_FACTORY_ERROR',
message:
"Failed to instantiate extension 'test', extension factory did not provide an iterable object",
context: { node: expect.anything() },
},
]);
@@ -1138,7 +1139,6 @@ describe('instantiateAppNodeTree', () => {
),
).toEqual([
{
// TODO: This should probably be EXTENSION_INVALID
code: 'EXTENSION_FACTORY_ERROR',
message:
"Failed to instantiate extension 'test', extension factory override did not provide an iterable object",
@@ -1157,7 +1157,6 @@ describe('instantiateAppNodeTree', () => {
),
).toEqual([
{
// TODO: This should probably be EXTENSION_INVALID
code: 'EXTENSION_FACTORY_ERROR',
message:
"Failed to instantiate extension 'test', extension factory middleware did not provide an iterable object",
@@ -1175,8 +1174,9 @@ describe('instantiateAppNodeTree', () => {
),
).toEqual([
{
code: 'EXTENSION_INVALID',
message: 'extension factory did not provide an iterable object',
code: 'EXTENSION_FACTORY_ERROR',
message:
"Failed to instantiate extension 'test:test', extension factory did not provide an iterable object",
context: { node: expect.anything() },
},
]);
@@ -1194,8 +1194,9 @@ describe('instantiateAppNodeTree', () => {
),
).toEqual([
{
code: 'EXTENSION_INVALID',
message: 'extension factory did not provide an iterable object',
code: 'EXTENSION_FACTORY_ERROR',
message:
"Failed to instantiate extension 'test:test', extension factory did not provide an iterable object",
context: { node: expect.anything() },
},
]);
@@ -1214,7 +1215,6 @@ describe('instantiateAppNodeTree', () => {
),
).toEqual([
{
// TODO: This should probably be EXTENSION_INVALID
code: 'EXTENSION_FACTORY_ERROR',
message:
"Failed to instantiate extension 'test:test', extension factory did not provide an iterable object",
@@ -1236,7 +1236,6 @@ describe('instantiateAppNodeTree', () => {
),
).toEqual([
{
// TODO: This should probably be EXTENSION_INVALID
code: 'EXTENSION_FACTORY_ERROR',
message:
"Failed to instantiate extension 'test:test', original blueprint factory did not provide an iterable object",
@@ -392,11 +392,7 @@ export function createAppNodeInstance(options: {
typeof outputDataValues !== 'object' ||
!outputDataValues?.[Symbol.iterator]
) {
collector.report({
code: 'EXTENSION_INVALID',
message: 'extension factory did not provide an iterable object',
});
throw INSTANTIATION_FAILED;
throw new Error('extension factory did not provide an iterable object');
}
const outputDataMap = new Map<string, unknown>();