Skip to content

Commit

Permalink
Merge pull request RocketChat#137 from assistify/136-extennd-logginng
Browse files Browse the repository at this point in the history
add extended logging information when loading smarti js RocketChat#136
  • Loading branch information
mrsimpson authored Nov 3, 2017
2 parents fedd280 + 2a85593 commit e8464d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/assistify-ai/server/methods/getSmartiUiScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ function loadSmarti() {
RocketChat.settings.get('DBS_AI_Redlink_URL').endsWith('/') ?
RocketChat.settings.get('DBS_AI_Redlink_URL') :
`${ RocketChat.settings.get('DBS_AI_Redlink_URL') }/`;
SystemLogger.debug('Trying to retrieve Smarti UI from', DBS_AI_SMARTI_URL);
const DBS_AI_SMARTI_WIDGET_URL = `${ DBS_AI_SMARTI_URL }plugin/v1/rocket.chat.js`;

let response = null;
try {
response = HTTP.get(`${ DBS_AI_SMARTI_URL }plugin/v1/rocket.chat.js`);
SystemLogger.debug('Trying to retrieve Smarti-Widget script from', DBS_AI_SMARTI_WIDGET_URL);
response = HTTP.get(DBS_AI_SMARTI_WIDGET_URL);
} catch (error) {
SystemLogger.error('Could not reach Smarti service at', DBS_AI_SMARTI_URL);
SystemLogger.error('Could not load the Smarti-Widget script at', DBS_AI_SMARTI_URL);
SystemLogger.debug(error);
throw new Meteor.Error('error-unreachable-url');
}

Expand Down

0 comments on commit e8464d0

Please sign in to comment.