states.cloud: handle better the error outputs

/cc @techhat @regilero