[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [MirageOS-devel] load/startup time error handling
On Tue, Oct 4, 2016 at 12:04 PM, Anil Madhavapeddy <anil@xxxxxxxxxx> wrote: On 1 Oct 2016, at 21:49, Hannes Mehnert <hannes@xxxxxxxxxxx> wrote: If we're up for a bit of temporary breakage then I'm very keen to move some of the type definitions out of the V1 signatures so we don't have to cut and paste them all over the place. For example with `BLOCK` we have: type error = [ | `Unknown of string (** an undiagnosed error *) | `Unimplemented (** operation not yet implemented in the code *) | `Is_read_only (** you cannot write to a read/only instance *) | `Disconnected (** the device has been previously disconnected *) ] ... type info = { read_write: bool; (** True if we can write, false if read/only *) sector_size: int; (** Octets per sector *) size_sectors: int64; (** Total sectors per device *) } ... Since these types don't refer to any abstract types in the signature I think it's pointless having them there. It would also be good to replace [`Unknown of string] and probably [`Unimplemented] with the [`Msg of string] as recommended by the Rresult docs-- I don't think either error can really be handled. Perhaps [`Disconnected] falls into the same category since it indicates a bug in the application (use after [disconnect]). Of those 4 errors perhaps only [`Is_read_only] is worth keeping since it refers to something in the environment rather than a bug in the code. WDYT? Cheers, Dave
Dave Scott
_______________________________________________ MirageOS-devel mailing list MirageOS-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |