Changed as.state to be callable to comply to the spec
Changed to always set as.state.error_info on as.error()