From 9585fd06d584b7300be72c9f6bcb57f496102dad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl>
Date: Fri, 9 Jul 2021 16:07:06 +0200
Subject: [PATCH] fix bugs

---
 README.md            | 1 +
 setup.cfg            | 2 +-
 tempsdb/metadata.pxd | 2 +-
 tempsdb/metadata.pyx | 4 ++--
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 3845f2d..040a7cc 100644
--- a/README.md
+++ b/README.md
@@ -58,6 +58,7 @@ Consult the docs for how to disable it.
 * fixed a bug with slicing chunks in `VarlenSeries`
 * added extra comparison operators for `VarlenEntry`
 * added `sync` to `VarlenSeries`
+* fixed a bug with not propagating metadata write exceptions
 
 ## v0.6.3
 
diff --git a/setup.cfg b/setup.cfg
index 6666d1a..57f81fd 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,7 +1,7 @@
 # coding: utf-8
 [metadata]
 name = tempsdb
-version = 0.6.4a6
+version = 0.6.4a7
 long-description = file: README.md
 long-description-content-type = text/markdown; charset=UTF-8
 license_files = LICENSE
diff --git a/tempsdb/metadata.pxd b/tempsdb/metadata.pxd
index 1e3651f..8276e52 100644
--- a/tempsdb/metadata.pxd
+++ b/tempsdb/metadata.pxd
@@ -5,4 +5,4 @@ cdef enum:
 
 
 cdef dict read_meta_at(str path)
-cdef int write_meta_at(str path, dict meta)
+cdef int write_meta_at(str path, dict meta) except -1
diff --git a/tempsdb/metadata.pyx b/tempsdb/metadata.pyx
index b4aac46..35e858f 100644
--- a/tempsdb/metadata.pyx
+++ b/tempsdb/metadata.pyx
@@ -39,7 +39,7 @@ cdef inline int write_meta_json(str path, dict meta):
     write_json_to_file(os.path.join(path, METADATA_FILE_NAME), meta)
     return 0
 
-cdef int write_meta_at(str path, dict meta):
+cdef int write_meta_at(str path, dict meta) except -1:
     cdef:
         bint exists_minijson = os.path.exists(os.path.join(path, METADATA_MINIJSON_FILE_NAME))
         bint exists_json = os.path.exists(os.path.join(path, METADATA_FILE_NAME))
@@ -57,4 +57,4 @@ cdef int write_meta_at(str path, dict meta):
         return write_meta_json(path, meta)
     else:
         raise EnvironmentError('both metadata files exists!')
-    return 0
+
-- 
GitLab