Add functions for manipulating errors in Result(T)
Add functions for manipulating errors in Result(T)

There is often need to manipulate these errors, for example to convert a String
from Result into an exception. These functions make this easier.

Function 'toErrorStr' lifts 'Result' to any 'MonadError'. This is useful
for converting 'Result' into 'ResultT' or any other similar monad stack.

Functions 'catchErrorT' and 'handleErrorT' catch errors just as 'catchError'
does, but also allow to change the error type.

Functions `withError` and `withErrorT` allow to modify an error within
GenericResult or ResultT. This is convenient when combining functions
with different error types, for example to convert between strings and
exceptions.

Furthemore, 'failError' generalize 'Bad'. It can be used anywhere 'Bad' is, and
in any 'MonadError' instance.

Signed-off-by: Petr Pudlak <9d19625f8ee825a2c398462ed335cbcf98f79c32@google.com>
Reviewed-by: Klaus Aehlig <4ce51de36d9068cd7db2eec1151e0f3f95419008@google.com>

yiannist/ganeti,yiannist/ganeti,apyrgio/ganeti,leshchevds/ganeti,andir/ganeti,mbakke/ganeti,ganeti-github-testing/ganeti-test-1,ganeti/ganeti,ganeti-github-testing/ganeti-test-1,onponomarev/ganeti,mbakke/ganeti,bitemyapp/ganeti,mbakke/ganeti,grnet/snf-ganeti,onponomarev/ganeti,andir/ganeti,grnet/snf-ganeti,leshchevds/ganeti,dimara/ganeti,dimara/ganeti,andir/ganeti,ganeti/ganeti,bitemyapp/ganeti,ganeti/ganeti,yiannist/ganeti,leshchevds/ganeti,apyrgio/ganeti