diff --git a/src/utils/HDF5.cpp b/src/utils/HDF5.cpp
index 4249d3520e3ce10a31b3419016d2bfd47288c088..a0a57d57da2843e414e4c4b5231b5ed4a77fd458 100644
--- a/src/utils/HDF5.cpp
+++ b/src/utils/HDF5.cpp
@@ -165,8 +165,7 @@ HDF5::_readAttribute(const HDFId<id_type>& id, const std::string& name, const Da
     hid_t attribute_type = H5Aget_type(attribute_id);
     if (not H5Tequal(attribute_type, type)) {
       std::ostringstream error_msg;
-      error_msg << "invalid type for attribute '" << rang::fgB::yellow << name << rang::fg::reset << "' got "
-                << H5Aget_type(attribute_id) << " expecting " << type;
+      error_msg << "invalid type for attribute '" << rang::fgB::yellow << name << rang::fg::reset << "'";
       throw NormalError(error_msg.str());
     }
 
diff --git a/tests/test_HDF5.cpp b/tests/test_HDF5.cpp
index f84b5f694b84770ac8ba0406ed423f265f429f01..bb1ceabe5be84cca3223dfc25c53508a8c6749ab 100644
--- a/tests/test_HDF5.cpp
+++ b/tests/test_HDF5.cpp
@@ -18,7 +18,6 @@ TEST_CASE("HDF5", "[utils]")
 
   SECTION("create file")
   {
-    std::clog << "filename = " << filename << '\n';
     HDF5::FileId file_id = HDF5::create(filename);
     REQUIRE(file_id >= 0);
     HDF5::close(file_id);
@@ -26,7 +25,6 @@ TEST_CASE("HDF5", "[utils]")
 
   SECTION("open file and add attributes")
   {
-    std::clog << "filename = " << filename << '\n';
     HDF5::FileId file_id = HDF5::openFileRW(filename);
     REQUIRE(file_id >= 0);
 
@@ -56,7 +54,6 @@ TEST_CASE("HDF5", "[utils]")
 
   SECTION("open file ro")
   {
-    std::clog << "filename = " << filename << '\n';
     HDF5::FileId file_id = HDF5::openFileRW(filename);
     REQUIRE(file_id >= 0);
 
@@ -85,7 +82,7 @@ TEST_CASE("HDF5", "[utils]")
     REQUIRE_THROWS_WITH(HDF5::readAttribute<double>(file_id, "invalid attr"),
                         "error: cannot find attribute 'invalid attr'");
     REQUIRE_THROWS_WITH(HDF5::readAttribute<double>(file_id, "int64_t attr"),
-                        "error: cannot find attribute 'invalid attr'");
+                        "error: invalid type for attribute 'int64_t attr'");
 
     HDF5::close(file_id);
   }