this should only be called with an error or a result, not both as it currently is, this might be out of scope for this but it will cause some subtle errors