Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
11 changes: 10 additions & 1 deletion Composer/packages/server/src/models/bot/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,16 @@ export class Builder {
await this.runQnaBuild(interruptionQnaFiles);
await this.runOrchestratorBuild(orchestratorBuildFiles, emptyFiles);
} catch (error) {
throw new Error(error.message ?? error.text ?? 'Error publishing to LUIS or QNA.');
// handle this special error case where QnA Maker returns this uninformative error.
// in their portal, it is accompanied by a message about the search service limits
// (A free search is limited to 3 indexes, which can be used up quickly)
if (error.text === 'Qnamaker build failed: Runtime error.') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the error always going to be in English?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error from Qnamaker?

Or are you saying we should formatMessage this error?

Copy link
Contributor

@hatpick hatpick Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

former.

I see that the runQnaBuild is sending a culture that is basically a locale (that seems to be en-us at all times!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good question! I don't know how to change that setting...

throw new Error(
'QnA Maker build failed: This error may indicate that your Search service requires an upgrade. For information about the Search service limits, see here: https://docs.microsoft.com/en-us/azure/search/search-limits-quotas-capacity'
);
} else {
throw new Error(error.message ?? error.text ?? 'Error publishing to LUIS or QNA.');
}
}
};

Expand Down