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

Merge pull request #3432 from overleaf/hb-handle-github-name-errors

return to and then display when name errors recieved from github sync

GitOrigin-RevId: 20d1b4851530e0174a0d0f4e02a24fbdffa4bd92
Hugh O'Brien 5 лет назад
Родитель
Сommit
e7b490a056

+ 6 - 1
services/web/app/src/Features/ThirdPartyDataStore/TpdsController.js

@@ -15,6 +15,7 @@ let parseParams
 
 const tpdsUpdateHandler = require('./TpdsUpdateHandler')
 const UpdateMerger = require('./UpdateMerger')
+const Errors = require('../Errors/Errors')
 const logger = require('logger-sharelatex')
 const Path = require('path')
 const metrics = require('@overleaf/metrics')
@@ -114,7 +115,11 @@ module.exports = {
       source,
       function(error) {
         if (error != null) {
-          return next(error)
+          if (error.constructor === Errors.InvalidNameError) {
+            return res.sendStatus(422)
+          } else {
+            return next(error)
+          }
         }
         return res.sendStatus(200)
       }

+ 1 - 0
services/web/locales/en.json

@@ -3,6 +3,7 @@
   "validation_issue_description": "This project did not compile because of a validation issue",
   "compile_error_entry_description": "An error which prevented this project from compiling",
   "validation_issue_entry_description": "A validation issue which prevented this project from compiling",
+  "github_file_name_error": "Your project contains file(s) with an invalid filename. Please check your repository and try again.",
   "raw_logs_description": "Raw logs from the LaTeX compiler",
   "raw_logs": "Raw logs",
   "first_error_popup_label": "This project has errors. This is the first one.",