Guide users to liberasurecode messages in syslog upon errors

This commit is contained in:
Tushar Gohad
2015-03-11 09:27:47 -07:00
parent 1c9fc482b0
commit 16cbe3c9f6
2 changed files with 4 additions and 0 deletions

View File

@@ -112,6 +112,8 @@ liberasurecode_errstr(int ret, const char * prefix, char str[])
strcat(str, "Unknown error");
break;
}
strcat(str, ". Please inspect syslog for liberasurecode error report.");
}
/**

View File

@@ -517,6 +517,7 @@ class TestPyECLibDriver(unittest.TestCase):
except:
got_exception = True
self.assertTrue(got_exception)
def test_liberasurecode_error(self):
pyeclib_driver = self.get_available_backend(k=10, m=5, ec_type="flat_xor_hd_3")
file_size = self.file_sizes[0]
@@ -535,6 +536,7 @@ class TestPyECLibDriver(unittest.TestCase):
pyeclib_driver.reconstruct([fragments[0]], [1,2,3,4,5,6])
except ECDriverError as e:
hit_exception = True
print e.error_str.__str__()
self.assertTrue(e.error_str.__str__().find("Insufficient number of fragments") > -1)
self.assertTrue(hit_exception)