catch error writing to cache