refactor error handling propagation