Revision 6a3a5bf7 ui/static/snf/js/ui/web/ui_error_view.js
b/ui/static/snf/js/ui/web/ui_error_view.js | ||
---|---|---|
82 | 82 |
|
83 | 83 |
show_error: function(ns, code, message, type, details, error_options) { |
84 | 84 |
if (!snf.api.error_state) { this.error_stack = {} }; |
85 |
|
|
86 |
snf.api.error_state = true; |
|
87 |
snf.api.trigger("change:error_state", true); |
|
85 |
|
|
86 |
if (error_options.fatal_error) { |
|
87 |
snf.api.error_state = true; |
|
88 |
snf.api.trigger("change:error_state", true); |
|
89 |
} else { |
|
90 |
snf.api.error_state = false; |
|
91 |
snf.api.trigger("change:error_state", false); |
|
92 |
} |
|
88 | 93 |
|
89 | 94 |
var error_entry = [ns, code, message, type, details, error_options]; |
90 | 95 |
this.error_stack[new Date()] = error_entry; |
... | ... | |
93 | 98 |
}, |
94 | 99 |
|
95 | 100 |
display_error: function(ns, code, message, type, details, error_options) { |
96 |
this.error_options = {'allow_report': true, 'allow_reload': true, 'extra_details': {}, 'non_critical': false}; |
|
101 |
this.error_options = {'allow_report': true, 'allow_reload': true, 'extra_details': {}, 'non_critical': false, 'allow_details': false };
|
|
97 | 102 |
|
98 | 103 |
if (error_options) { |
99 | 104 |
this.error_options = _.extend(this.error_options, error_options); |
... | ... | |
109 | 114 |
|
110 | 115 |
if (error_options.non_critical) { |
111 | 116 |
this.el.addClass("non-critical"); |
117 |
this.error_options.allow_details = false; |
|
112 | 118 |
} else { |
113 | 119 |
this.el.removeClass("non-critical"); |
120 |
this.error_options.allow_details = true; |
|
114 | 121 |
} |
122 |
|
|
123 |
//if (APP_DEBUG) { |
|
124 |
//this.error_options.allow_details = true; |
|
125 |
//} |
|
115 | 126 |
|
116 | 127 |
this.$(".actions .show-details").click(); |
117 | 128 |
this.$(".key.details").click(); |
... | ... | |
143 | 154 |
this.$(".error-details").hide(); |
144 | 155 |
this.$(".show-details").show(); |
145 | 156 |
this.$(".hide-details").hide(); |
157 |
|
|
158 |
if (this.error_options.allow_details) { |
|
159 |
this.$(".show-details").show(); |
|
160 |
} else { |
|
161 |
this.$(".show-details").hide(); |
|
162 |
} |
|
146 | 163 |
|
147 | 164 |
if (this.error_options.allow_report) { |
148 | 165 |
this.$(".report-error").show(); |
Also available in: Unified diff