summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-05-11 12:47:37 +0000
committerMike Buland <eichlan@xagasoft.com>2010-05-11 12:47:37 +0000
commit70be76029b39d9d909ce9c069c1564d5d476fc22 (patch)
treef06f8a381edae45b9115145a99fffd4b08dfd882 /src
parent9731dc86fa9b12adc064b99910dddb58932c71cf (diff)
downloadlibbu++-70be76029b39d9d909ce9c069c1564d5d476fc22.tar.gz
libbu++-70be76029b39d9d909ce9c069c1564d5d476fc22.tar.bz2
libbu++-70be76029b39d9d909ce9c069c1564d5d476fc22.tar.xz
libbu++-70be76029b39d9d909ce9c069c1564d5d476fc22.zip
Cache store mimics the others now. I need to make a standard exception for
cache stores to throw.
Diffstat (limited to 'src')
-rw-r--r--src/cachestorefiles.h19
1 files 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
68 68
69 virtual obtype *load( const keytype &key ) 69 virtual obtype *load( const keytype &key )
70 { 70 {
71 Bu::MemBuf mb; 71 try
72 Bu::Formatter f( mb ); 72 {
73 f << sPrefix << "/" << key; 73 Bu::MemBuf mb;
74 Bu::File fIn( mb.getString(), Bu::File::Read ); 74 Bu::Formatter f( mb );
75 obtype *pOb = __cacheStoreFilesLoad<keytype, obtype>( fIn, key ); 75 f << sPrefix << "/" << key;
76 return pOb; 76 Bu::File fIn( mb.getString(), Bu::File::Read );
77 obtype *pOb = __cacheStoreFilesLoad<keytype, obtype>( fIn, key );
78 return pOb;
79 }
80 catch(...)
81 {
82 throw Bu::HashException("File-key not found.");
83 }
77 } 84 }
78 85
79 virtual void unload( obtype *pObj, const keytype &key ) 86 virtual void unload( obtype *pObj, const keytype &key )