Skip to content

Commit

Permalink
added more error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
NoxelS committed Jan 29, 2024
1 parent 05bfb9d commit 69f1ec0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import { MysqlError, Pool } from 'mysql';
* @param callback Callback function
* @param pool Pool to use
*/
export function query(query: string, inputs: any[], callback: (error: MysqlError, result: any[]) => void, pool: Pool) {
export function query(query: string, inputs: any[], callback: (error: MysqlError, result: any[]) => void, pool: Pool) : void {
pool.getConnection(function (error, connection) {
if (error) callback(error, []);
connection.beginTransaction(function (error) {
if (error) {
// Transaction Error (Rollback and release connection)
Expand Down

0 comments on commit 69f1ec0

Please sign in to comment.