[Kimchi-devel] [PATCH ] Show error message if debug report generation errors.

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Tue Mar 25 19:21:27 UTC 2014


On 03/25/2014 11:27 AM, Leonardo Garcia wrote:
> From: Leonardo Garcia <lagarcia at br.ibm.com>
>
> If the process of generating a debug report in Kimchi fails while it
> was executing (e.g. due to running out of disk space to generate the
> report), the error message was not being shown in the Kimchi UI. Basically
> src/kimchi/control/tasks.py was putting the error message in a JSON field
> called message, while the UI was looking for the error message in a field
> called reason.
>
> Signed-off-by: Leonardo Garcia <lagarcia at br.ibm.com>
> ---
>   ui/js/src/kimchi.report_add_main.js | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/ui/js/src/kimchi.report_add_main.js b/ui/js/src/kimchi.report_add_main.js
> index 15cc76b..3248e2f 100644
> --- a/ui/js/src/kimchi.report_add_main.js
> +++ b/ui/js/src/kimchi.report_add_main.js
> @@ -23,11 +23,11 @@ kimchi.report_add_main = function() {
>                   result: result
>               });
>           }, function(result) {
> -            if (result['reason']) {
> -                var errText = result['reason'];
> +            if (result['message']) {
> +                var errText = result['message'];
>               }
>               else {
> -                var errText = result['responseJSON']['reason'];

We must keep "reason" here. The 'if' is expecting error message from 
Asynctask json, the 'else' is
expecting error message from standard Kimchi exception. Jsons are different.

> +                var errText = result['responseJSON']['message'];
>               }
>               result && kimchi.message.error(errText)
>               submitButton




More information about the Kimchi-devel mailing list