Can you refactor this to accept 2 arguments:
- error_data
- kwargs, where kwargs is an object with keys params, environment and session
?