Explorar el Código

Show an explanation error message on too many track changes error

James Allen hace 9 años
padre
commit
3c2f5525a1
Se han modificado 1 ficheros con 12 adiciones y 1 borrados
  1. 12 1
      services/web/public/coffee/ide/editor/EditorManager.coffee

+ 12 - 1
services/web/public/coffee/ide/editor/EditorManager.coffee

@@ -121,11 +121,22 @@ define [
 
 
 		_bindToDocumentEvents: (doc, sharejs_doc) ->
 		_bindToDocumentEvents: (doc, sharejs_doc) ->
 			sharejs_doc.on "error", (error, meta) =>
 			sharejs_doc.on "error", (error, meta) =>
-				if error?.message?.match "maxDocLength"
+				if error?.message?
+					message = error.message
+				else if typeof error == "string"
+					message = error
+				else
+					message = ""
+				if message.match "maxDocLength"
 					@ide.showGenericMessageModal(
 					@ide.showGenericMessageModal(
 						"Document Too Long"
 						"Document Too Long"
 						"Sorry, this file is too long to be edited manually. Please upload it directly."
 						"Sorry, this file is too long to be edited manually. Please upload it directly."
 					)
 					)
+				else if message.match "too many comments or tracked changes"
+					@ide.showGenericMessageModal(
+						"Too many comments or tracked changes"
+						"Sorry, this file has too many comments or tracked changes. Please try accepting or rejecting some existing changes, or resolving and deleting some comments."
+					)
 				else
 				else
 					@ide.socket.disconnect()
 					@ide.socket.disconnect()
 					@ide.reportError(error, meta)
 					@ide.reportError(error, meta)