MCPcopy
hub / github.com/sequelize/sequelize / logWarnings

Method logWarnings

lib/dialects/mariadb/query.js:200–222  ·  view source on GitHub ↗
(results)

Source from the content-addressed store, hash-verified

198 }
199
200 async logWarnings(results) {
201 const warningResults = await this.run('SHOW WARNINGS');
202 const warningMessage = `MariaDB Warnings (${this.connection.uuid || 'default'}): `;
203 const messages = [];
204 for (const _warningRow of warningResults) {
205 if (_warningRow === undefined || typeof _warningRow[Symbol.iterator] !== 'function') {
206 continue;
207 }
208 for (const _warningResult of _warningRow) {
209 if (Object.prototype.hasOwnProperty.call(_warningResult, 'Message')) {
210 messages.push(_warningResult.Message);
211 } else {
212 for (const _objectKey of _warningResult.keys()) {
213 messages.push([_objectKey, _warningResult[_objectKey]].join(': '));
214 }
215 }
216 }
217 }
218
219 this.sequelize.log(warningMessage + messages.join('; '), this.options);
220
221 return results;
222 }
223
224 formatError(err, errStack) {
225 switch (err.errno) {

Callers 1

runMethod · 0.95

Calls 2

runMethod · 0.95
logMethod · 0.80

Tested by

no test coverage detected