WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

RE: [Xen-API] [PATCH]Make error msg more readable when sr-create returns

To: 'Yang Hongyang' <yanghy@xxxxxxxxxxxxxx>, "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-API] [PATCH]Make error msg more readable when sr-create returns sr_backend_failure
From: Dave Scott <Dave.Scott@xxxxxxxxxxxxx>
Date: Tue, 20 Apr 2010 15:10:34 +0100
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Tue, 20 Apr 2010 07:11:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4BCD480B.3000608@xxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <4BCD480B.3000608@xxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcrgUYL/NilEEFK5RlekmHJECSiKgAAQAkCw
Thread-topic: [Xen-API] [PATCH]Make error msg more readable when sr-create returns sr_backend_failure
Hi,

> Make error msg more readable when sr-create returns
> sr_backend_failure.I think it is a bug here.

The current system is very ugly but it's working as intended here. The idea is 
that each error has a distinct code (the first string) e.g.
  SR_BACKEND_FAILURE_xx
And then for i18n we can have a simple table mapping
  Unique code -> message with {1} numbered {2} holes for arguments.

> before:
> # xe sr-create name-label=test type=iso device-
> config:location=/var/opt/xen/iso_import/test device-
> config:legacy_mode=true content-type=iso Error code:
> SR_BACKEND_FAILURE_226 Error parameters: , Invalid local path,

This definitely looks ugly. I'd like to fix it in the CLI by catching all 
exceptions SR_BACKEND_FAILURE_* and writing a more intelligent pretty-printer.

Cheers,
Dave
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>