@@ -16,10 +16,13 @@ |
||
16 | 16 | public function getDatabasePath() |
17 | 17 | { |
18 | 18 | try { |
19 | - if (!array_key_exists('database', $this->config)) throw new Exception('The config has no entry with key "database".'); |
|
20 | - if (!array_key_exists('path', $this->config['database'])) throw new Exception('The config has no entry with key "database/path".'); |
|
21 | - } |
|
22 | - catch (Exception $exception) { |
|
19 | + if (!array_key_exists('database', $this->config)) { |
|
20 | + throw new Exception('The config has no entry with key "database".'); |
|
21 | + } |
|
22 | + if (!array_key_exists('path', $this->config['database'])) { |
|
23 | + throw new Exception('The config has no entry with key "database/path".'); |
|
24 | + } |
|
25 | + } catch (Exception $exception) { |
|
23 | 26 | throw new Exception('Missing config: '.$exception->getMessage()); |
24 | 27 | } |
25 | 28 |
@@ -70,8 +70,7 @@ |
||
70 | 70 | } |
71 | 71 | $this->documentManager->insert($collection, $document); |
72 | 72 | $output .= "Inserted document in the $collection collection.\n"; |
73 | - } |
|
74 | - catch (Exception $exception) { |
|
73 | + } catch (Exception $exception) { |
|
75 | 74 | $output .= "Error: ".$exception->getMessage()."\n"; |
76 | 75 | } |
77 | 76 | break; |