diff --git a/lib/setup.php b/lib/setup.php
index e1c1a110b38333bbb0f0eb30abc70c0917bb3acb..59c3aefbf13aec36f6dfea364f67569e6c1e4355 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -163,6 +163,7 @@ class OC_Setup {
 						'error' => 'PostgreSQL username and/or password not valid',
 						'hint' => 'You need to enter either an existing account or the administrator.'
 					);
+					return $error;
 				}
 				else {
 					//check for roles creation rights in postgresql