diff options
Diffstat (limited to 'application/bookmark/BookmarkIO.php')
-rw-r--r-- | application/bookmark/BookmarkIO.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/application/bookmark/BookmarkIO.php b/application/bookmark/BookmarkIO.php index 1026e2f9..6bf7f365 100644 --- a/application/bookmark/BookmarkIO.php +++ b/application/bookmark/BookmarkIO.php | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | namespace Shaarli\Bookmark; | 3 | namespace Shaarli\Bookmark; |
4 | 4 | ||
5 | use Shaarli\Bookmark\Exception\DatastoreNotInitializedException; | ||
5 | use Shaarli\Bookmark\Exception\EmptyDataStoreException; | 6 | use Shaarli\Bookmark\Exception\EmptyDataStoreException; |
6 | use Shaarli\Bookmark\Exception\NotWritableDataStoreException; | 7 | use Shaarli\Bookmark\Exception\NotWritableDataStoreException; |
7 | use Shaarli\Config\ConfigManager; | 8 | use Shaarli\Config\ConfigManager; |
@@ -52,13 +53,14 @@ class BookmarkIO | |||
52 | * | 53 | * |
53 | * @return BookmarkArray instance | 54 | * @return BookmarkArray instance |
54 | * | 55 | * |
55 | * @throws NotWritableDataStoreException Data couldn't be loaded | 56 | * @throws NotWritableDataStoreException Data couldn't be loaded |
56 | * @throws EmptyDataStoreException Datastore doesn't exist | 57 | * @throws EmptyDataStoreException Datastore file exists but does not contain any bookmark |
58 | * @throws DatastoreNotInitializedException File does not exists | ||
57 | */ | 59 | */ |
58 | public function read() | 60 | public function read() |
59 | { | 61 | { |
60 | if (! file_exists($this->datastore)) { | 62 | if (! file_exists($this->datastore)) { |
61 | throw new EmptyDataStoreException(); | 63 | throw new DatastoreNotInitializedException(); |
62 | } | 64 | } |
63 | 65 | ||
64 | if (!is_writable($this->datastore)) { | 66 | if (!is_writable($this->datastore)) { |