instead of calling `resource_is_ready` to raise an error if the resource is in error, we could add a new parameter to `check_resource` (call it, e.g., `raise_on_error`) and do the error raising inside that function.