File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export const examples = [
25
25
responseType : 'text' ,
26
26
withCredentials : false ,
27
27
skipSameURL : true ,
28
+ showErrors : true ,
28
29
29
30
showTime : false ,
30
31
showTimePrefix : null ,
Original file line number Diff line number Diff line change @@ -464,8 +464,10 @@ class AjaxCtrl extends MetricsPanelCtrl {
464
464
}
465
465
466
466
let txt = `<h1>${ msg } </h1>` ;
467
- if ( err ) {
467
+ if ( err && this . panel . showErrors ) {
468
468
txt += '<pre>' + JSON . stringify ( err ) + '</pre>' ;
469
+ } else {
470
+ txt += '<pre>Something went wrong while executing your request.</pre>' ;
469
471
}
470
472
471
473
this . ngtemplate . html ( txt ) ;
Original file line number Diff line number Diff line change @@ -69,6 +69,13 @@ <h5 class="section-heading">Source</h5>
69
69
label-class ="width-9 "
70
70
checked ="ctrl.panel.skipSameURL "
71
71
on-change ="ctrl.onConfigChanged() "> </ gf-form-switch >
72
+ < gf-form-switch
73
+ class ="gf-form "
74
+ tooltip ="Show/Hide error messages. "
75
+ label ="Show Errors "
76
+ label-class ="width-9 "
77
+ checked ="ctrl.panel.showErrors "
78
+ on-change ="ctrl.onConfigChanged() "> </ gf-form-switch >
72
79
</ div >
73
80
74
81
You can’t perform that action at this time.
0 commit comments