Skip to content

Commit

Permalink
fix(core.gbapp): NLP is not required in startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Apr 18, 2021
1 parent b0d45c3 commit b120cf6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/core.gbapp/services/GBConversationalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,14 +618,15 @@ export class GBConversationalService {
nlp = await model.recognize(step.context, {}, {}, { IncludeAllIntents: false, IncludeInstanceData: false, includeAPIResults: true });
step.context.activity.text = saved;
} catch (error) {

// tslint:disable:no-unsafe-any
if (error.statusCode === 404) {
if (error.statusCode === 404 || error.statusCode === 400) {
GBLog.warn('NLP application still not publish and there are no other options for answering.');

return false;
} else {
const msg = `Error calling NLP, check if you have a published model and assigned keys. Error: ${error.statusCode ? error.statusCode : ''
} {error.message; }`;
const msg = `Error calling NLP, check if you have a published model and assigned keys.
Error: ${error.statusCode ? error.statusCode : ''} ${error.message}`;

throw new Error(msg);
}
Expand Down

0 comments on commit b120cf6

Please sign in to comment.