eip-cloud-services 1.1.11 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/mysql.js +10 -3
package/package.json
CHANGED
package/src/mysql.js
CHANGED
|
@@ -27,9 +27,16 @@ const newQuery = ( connection, query ) => new Promise ( ( resolve, reject ) => {
|
|
|
27
27
|
connection.query ( query, ( error, results, fields ) => {
|
|
28
28
|
connection.release ();
|
|
29
29
|
if ( error ) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const MAX_ERROR_LENGTH = 500;
|
|
31
|
+
const MAX_QUERY_LENGTH = 300;
|
|
32
|
+
|
|
33
|
+
const shortError = (error?.stack || error?.message || String(error)).slice(0, MAX_ERROR_LENGTH);
|
|
34
|
+
const shortQuery = query.slice(0, MAX_QUERY_LENGTH);
|
|
35
|
+
|
|
36
|
+
console.error("Query Error:", shortError);
|
|
37
|
+
console.error("Truncated Query:", shortQuery);
|
|
38
|
+
|
|
39
|
+
reject(`There was a problem with query: ${shortError}`);
|
|
33
40
|
}
|
|
34
41
|
else {
|
|
35
42
|
resolve ( results );
|