Просмотр исходного кода

Quite the licence server not found error

Sergiu Miclea 7 лет назад
Родитель
Сommit
59f3f44f7e
2 измененных файлов с 3 добавлено и 3 удалено
  1. 1 1
      src/sources/LincenceSource.js
  2. 2 2
      src/utils/ApiCaller.js

+ 1 - 1
src/sources/LincenceSource.js

@@ -22,7 +22,7 @@ import type { Licence } from '../types/Licence'
 class LicenceSource {
   async loadLicenceInfo(): Promise<Licence> {
     let url = `${servicesUrl.licence}/licence-status`
-    let response = await Api.send({ url })
+    let response = await Api.send({ url, quietError: true })
     let root = response.data.licence_status
     return ({
       currentPeriodStart: new Date(root.current_period_start),

+ 2 - 2
src/utils/ApiCaller.js

@@ -142,7 +142,7 @@ class ApiCaller {
         } else if (error.request) {
           // The request was made but no response was received
           // `error.request` is an instance of XMLHttpRequest
-          if (!isOnLoginPage()) {
+          if (!isOnLoginPage() && !options.quietError) {
             notificationStore.alert(`Request failed, there might be a problem with the connection to the server. ${options.url}`, 'error')
           }
           logger.log({
@@ -175,7 +175,7 @@ class ApiCaller {
             description: 'Something happened in setting up the request',
             requestStatus: 500,
           })
-          notificationStore.alert('Request failed, there might be a problem with the connection to the server.', 'error')
+          notificationStore.alert(`Request failed, there might be a problem with the connection to the server. ${options.url}`, 'error')
         }
       })
     })