diff --git a/services/web/app/src/Features/Subscription/SubscriptionViewModelBuilder.js b/services/web/app/src/Features/Subscription/SubscriptionViewModelBuilder.js index cd865c65bd..f85c7e1e68 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionViewModelBuilder.js +++ b/services/web/app/src/Features/Subscription/SubscriptionViewModelBuilder.js @@ -11,7 +11,11 @@ const _ = require('underscore') const async = require('async') const SubscriptionHelper = require('./SubscriptionHelper') const { promisify } = require('../../util/promises') -const { InvalidError, NotFoundError } = require('../Errors/Errors') +const { + InvalidError, + NotFoundError, + V1ConnectionError, +} = require('../Errors/Errors') function buildHostedLink(type) { return `/user/subscription/recurly/${type}` @@ -109,7 +113,15 @@ function buildUsersSubscriptionViewModel(user, callback) { SubscriptionLocator.getManagedGroupSubscriptions(user, cb) }, currentInstitutionsWithLicence(cb) { - InstitutionsGetter.getCurrentInstitutionsWithLicence(user._id, cb) + InstitutionsGetter.getCurrentInstitutionsWithLicence( + user._id, + (error, institutions) => { + if (error instanceof V1ConnectionError) { + return cb(null, false) + } + cb(null, institutions) + } + ) }, managedInstitutions(cb) { InstitutionsGetter.getManagedInstitutions(user._id, cb) diff --git a/services/web/app/views/subscriptions/dashboard/_institution_memberships.pug b/services/web/app/views/subscriptions/dashboard/_institution_memberships.pug index 9556100c51..ea627edc0f 100644 --- a/services/web/app/views/subscriptions/dashboard/_institution_memberships.pug +++ b/services/web/app/views/subscriptions/dashboard/_institution_memberships.pug @@ -1,11 +1,15 @@ -each institution in currentInstitutionsWithLicence - -hasDisplayedSubscription = true - p - | You have a - | - strong(ng-non-bindable) Professional - | - | #{settings.appName} account as a confirmed member of - | - strong(ng-non-bindable)= institution.name - hr +if currentInstitutionsWithLicence === false + .alert.alert-warning + p Sorry, something went wrong. Subscription information related to institutional affiliations may not be displayed. Please try again later. +else + each institution in currentInstitutionsWithLicence + -hasDisplayedSubscription = true + p + | You have a + | + strong(ng-non-bindable) Professional + | + | #{settings.appName} account as a confirmed member of + | + strong(ng-non-bindable)= institution.name + hr