loleaflet/src/core/Socket.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit 29bb6be15bd916c398c95a9d3b44684e2ed95bc1 Author: Jan Holesovsky <ke...@collabora.com> Date: Thu Apr 12 16:30:32 2018 +0200 loleaflet: More friendly message when the websocket creation goes wrong. Change-Id: Iaf7be5895c7baede7d72114dea9fb93550ccac7e Reviewed-on: https://gerrit.libreoffice.org/53218 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 85fcfe9a4..edf143af6 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -32,10 +32,13 @@ L.Socket = L.Class.extend({ wopiSrc = '?WOPISrc=' + map.options.wopiSrc + '&compat=/ws'; } + var websocketURI = map.options.server + '/lool/' + encodeURIComponent(map.options.doc + '?' + $.param(map.options.docParams)) + '/ws' + wopiSrc; try { - this.socket = new WebSocket(map.options.server + '/lool/' + encodeURIComponent(map.options.doc + '?' + $.param(map.options.docParams)) + '/ws' + wopiSrc); + this.socket = new WebSocket(websocketURI); } catch (e) { - this._map.fire('error', {msg: _('Oops, there is a problem connecting to LibreOffice Online : ').replace('LibreOffice Online', (typeof brandProductName !== 'undefined' ? brandProductName : 'LibreOffice Online')) + e, cmd: 'socket', kind: 'failed', id: 3}); + this._map.fire('error', {msg: _('Oops, there is a problem connecting to LibreOffice Online : ').replace('LibreOffice Online', (typeof brandProductName !== 'undefined' ? brandProductName : 'LibreOffice Online')) + _('Cannot create websocket, please restart your browser.'), cmd: 'socket', kind: 'failed', id: 3}); + console.log('Failed to create websocket: ' + websocketURI); + console.log('Due to an exception: ' + e); return; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits