From 70be76029b39d9d909ce9c069c1564d5d476fc22 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 11 May 2010 12:47:37 +0000 Subject: Cache store mimics the others now. I need to make a standard exception for cache stores to throw. --- src/cachestorefiles.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/cachestorefiles.h b/src/cachestorefiles.h index 6b37d0a..0416f8b 100644 --- a/src/cachestorefiles.h +++ b/src/cachestorefiles.h @@ -68,12 +68,19 @@ namespace Bu virtual obtype *load( const keytype &key ) { - Bu::MemBuf mb; - Bu::Formatter f( mb ); - f << sPrefix << "/" << key; - Bu::File fIn( mb.getString(), Bu::File::Read ); - obtype *pOb = __cacheStoreFilesLoad( fIn, key ); - return pOb; + try + { + Bu::MemBuf mb; + Bu::Formatter f( mb ); + f << sPrefix << "/" << key; + Bu::File fIn( mb.getString(), Bu::File::Read ); + obtype *pOb = __cacheStoreFilesLoad( fIn, key ); + return pOb; + } + catch(...) + { + throw Bu::HashException("File-key not found."); + } } virtual void unload( obtype *pObj, const keytype &key ) -- cgit v1.2.3