[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: 'Yang Hongyang' <yanghy@xxxxxxxxxxxxxx>, "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
  • 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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.