diff --git a/core/database.class.php b/core/database.class.php
index 53abd16e..7ff1617b 100644
--- a/core/database.class.php
+++ b/core/database.class.php
@@ -349,9 +349,7 @@ class Database {
 			return $stmt;
 		}
 		catch(PDOException $pdoe) {
-			print 'Message: '.$pdoe->getMessage();
-			print '<p>Error: '.$query;
-			exit;
+			throw new SCoreException($pdoe->getMessage()."<p>Query: ".$query);
 		}
 	}