1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-10-24 20:36:06 +02:00

Enhance 'DatabaseError' instances to be more verbose

This commit is contained in:
Marco
2018-04-20 18:01:00 +02:00
parent 49a4ef8280
commit f6607f664d
3 changed files with 31 additions and 31 deletions

View File

@@ -172,7 +172,7 @@ abstract class UserManager {
throw new UserAlreadyExistsException();
}
catch (Error $e) {
throw new DatabaseError();
throw new DatabaseError($e->getMessage());
}
$newUserId = (int) $this->db->getLastInsertId();
@@ -207,7 +207,7 @@ abstract class UserManager {
}
}
catch (Error $e) {
throw new DatabaseError();
throw new DatabaseError($e->getMessage());
}
}
@@ -263,7 +263,7 @@ abstract class UserManager {
);
}
catch (Error $e) {
throw new DatabaseError();
throw new DatabaseError($e->getMessage());
}
if (empty($users)) {
@@ -356,7 +356,7 @@ abstract class UserManager {
);
}
catch (Error $e) {
throw new DatabaseError();
throw new DatabaseError($e->getMessage());
}
if (\is_callable($callback)) {
@@ -390,7 +390,7 @@ abstract class UserManager {
);
}
catch (Error $e) {
throw new DatabaseError();
throw new DatabaseError($e->getMessage());
}
}