Revision 0b416fc7 snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_error_view.js
b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_error_view.js | ||
---|---|---|
121 | 121 |
"Code: " + this.code + "\n" + |
122 | 122 |
"Type: " + this.type + "\n" + |
123 | 123 |
"Message: " + this.message + "\n" + |
124 |
"API Message: " + this.api_message + "\n" + |
|
124 | 125 |
"Module: " + this.ns + "\n" + |
125 | 126 |
"Details: " + this.details + "\n\n" + |
126 | 127 |
"Please describe the actions that triggered the error:\n" |
... | ... | |
128 | 129 |
return fdb_msg; |
129 | 130 |
}, |
130 | 131 |
|
131 |
show_error: function(ns, code, message, type, details, error_options) { |
|
132 |
show_error: function(ns, code, message, api_message, type, details, error_options) {
|
|
132 | 133 |
|
133 |
var error_entry = [ns, code, message, type, details, error_options]; |
|
134 |
var error_entry = [ns, code, message, api_message, type, details, error_options];
|
|
134 | 135 |
var last_error_key = this.update_errors_stack(error_entry); |
135 | 136 |
|
136 | 137 |
if (!this.is_visible && !this.displaying_error) { |
... | ... | |
196 | 197 |
|
197 | 198 |
display_error: function(stack_key) { |
198 | 199 |
var err = this.error_stack[stack_key]; |
199 |
var ns = err[0], code = err[1], message = err[2], type = err[3], details = err[4], error_options = err[5] |
|
200 |
var ns = err[0], code = err[1], message = err[2]; |
|
201 |
var api_message = err[3], type = err[4]; |
|
202 |
var details = err[5], error_options = err[6]; |
|
200 | 203 |
|
201 | 204 |
this.error_options = {'allow_report': true, 'allow_reload': true, |
202 | 205 |
'extra_details': {}, 'non_critical': false, |
... | ... | |
212 | 215 |
this.type = type; |
213 | 216 |
this.details = details ? (details.toString ? details.toString() : details) : undefined; |
214 | 217 |
this.message = message; |
215 |
this.title = error_options.title || undefined; |
|
218 |
this.api_message = api_message; |
|
219 |
this.title = _.escape(error_options.title) || undefined; |
|
216 | 220 |
|
217 | 221 |
this.update_details(); |
218 | 222 |
|
... | ... | |
244 | 248 |
this.$(".error-code").text(this.code || ""); |
245 | 249 |
this.$(".error-type").text(this.type || ""); |
246 | 250 |
this.$(".error-module").text(this.ns || ""); |
247 |
this.$(".message p").text(this.message || ""); |
|
251 |
if (this.api_message) { |
|
252 |
this.$(".message p").html($( |
|
253 |
"<span>{0}</span><br /><span class='api-message'>{1}</span>".format( |
|
254 |
_.escape(this.message), |
|
255 |
_.escape(this.api_message)))); |
|
256 |
} else { |
|
257 |
this.$(".message p").text(this.message || ""); |
|
258 |
} |
|
248 | 259 |
this.$(".error-more-details p").html($("<pre />", {text:this.details}) || "no info"); |
249 | 260 |
|
250 | 261 |
this.$(".extra-details").remove(); |
Also available in: Unified diff