Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
Error 0, logger 1.default) is not a function

This code was built to allow us to save errors to our database.

const logErrors = function (data) {
    try {
        let error = { date: new Date(), ...data };
        databaseConnections[dbMappings['BACKEND_ERROR_DB_MAPPING']['default']].collection('BackendLogs').insert(error);
    } catch (error) {
        const slackLog = new Log();
        slackLog.error(error.toString());
    }
};

export default logErrors;

The code works OK and saves errors to our database, but it occasionally throws the error "0, logger 1.default) is not a function."

What could be the problem?

Example scenario

catch (error) {
            // error.stack = error.stack + " " + JSON.stringify(this.data);
            if (error) {
                logErrors({ message: error }); <<<<<
            }
        }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!