From efc8beccd496f275663826ed507dd76728a75952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Tue, 16 May 2023 09:09:06 +0200 Subject: [PATCH] Better error message --- R/versions.R | 3 +++ tests/testthat/_snaps/old-data-type.md | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/R/versions.R b/R/versions.R index 08d888e7e0..cfda3984ae 100644 --- a/R/versions.R +++ b/R/versions.R @@ -104,6 +104,9 @@ check_version <- function(graph) { } warn_version <- function(graph) { + # Calling for side effect: error if R_SEXP_to_igraph() fails + vcount_impl(graph) + if (graph_version() != graph_version(graph)) { message( "This graph was created by an old(er) igraph version.\n", diff --git a/tests/testthat/_snaps/old-data-type.md b/tests/testthat/_snaps/old-data-type.md index 79fbf7d5ff..7f19013e7d 100644 --- a/tests/testthat/_snaps/old-data-type.md +++ b/tests/testthat/_snaps/old-data-type.md @@ -2,10 +2,6 @@ Code V(karate) - Message - This graph was created by an old(er) igraph version. - Call upgrade_graph() on it to use with the current igraph version - For now we convert it on the fly... Error This graph was created by a now unsupported old igraph version. Call upgrade_version() before using igraph functions on that object.