Add the Error exception and reorder the definitions of types

Unfortunately some of the field definitions mask each other,
so they need to be in the right order

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>