From 45eeb2912b36807868804450cb56b2cd27b4913e Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Sun, 19 Jun 2011 13:33:54 +0200 Subject: [PATCH] improve error handling --- scm-webapp/src/main/webapp/resources/js/i18n/de.js | 9 +++++++++ .../js/panel/sonia.panel.syntaxhighlighterpanel.js | 11 +++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/scm-webapp/src/main/webapp/resources/js/i18n/de.js b/scm-webapp/src/main/webapp/resources/js/i18n/de.js index 0a0caf3058..51ffdcde20 100644 --- a/scm-webapp/src/main/webapp/resources/js/i18n/de.js +++ b/scm-webapp/src/main/webapp/resources/js/i18n/de.js @@ -501,3 +501,12 @@ if (Sonia.scm.Main){ }); } + +if (Sonia.panel.SyntaxHighlighterPanel){ + + Ext.override(Sonia.panel.SyntaxHighlighterPanel, { + loadErrorTitleText: 'Fehler', + loadErrorMsgText: 'Die Datei konnte nicht geladen werden' + }); + +} diff --git a/scm-webapp/src/main/webapp/resources/js/panel/sonia.panel.syntaxhighlighterpanel.js b/scm-webapp/src/main/webapp/resources/js/panel/sonia.panel.syntaxhighlighterpanel.js index cabf42d8f8..7790b06704 100644 --- a/scm-webapp/src/main/webapp/resources/js/panel/sonia.panel.syntaxhighlighterpanel.js +++ b/scm-webapp/src/main/webapp/resources/js/panel/sonia.panel.syntaxhighlighterpanel.js @@ -137,6 +137,9 @@ Sonia.panel.SyntaxHighlighterPanel = Ext.extend(Ext.Panel, { shPath: 'resources/syntaxhighlighter', contentUrl: null, + loadErrorTitleText: 'Error', + loadErrorMsgText: 'Could not load file', + contentLoaded: false, scriptsLoaded: false, @@ -211,8 +214,12 @@ Sonia.panel.SyntaxHighlighterPanel = Ext.extend(Ext.Panel, { this.contentLoaded = true; this.highlight(); }, - failure: function(){ - // TODO + failure: function(result){ + main.handleFailure( + result.status, + this.loadErrorTitleText, + this.loadErrorMsgText + ); } }); },