chore: migrating to nodejs 22

This commit is contained in:
Rafael Taranto 2025-03-08 12:28:23 +00:00
parent 0296f86060
commit 2e31ab391f
47 changed files with 16384 additions and 11137 deletions

View file

@ -13,7 +13,7 @@ const dbm = require('./postgresql_interface')
const configManager = require('./new-config-manager')
const notifierUtils = require('./notifier/utils')
const notifierQueries = require('./notifier/queries')
const { ApolloError } = require('apollo-server-errors');
const { GraphQLError } = require('graphql');
const { loadLatestConfig } = require('./new-settings-loader')
const logger = require('./logger')
@ -154,7 +154,7 @@ function getMachine (machineId, config) {
const sql = `${MACHINE_WITH_CALCULATED_FIELD_SQL} WHERE d.device_id = $1`
const queryMachine = db.oneOrNone(sql, [machineId]).then(r => {
if (r === null) throw new ApolloError('Resource doesn\'t exist', 'NOT_FOUND')
if (r === null) throw new GraphQLError('Resource doesn\'t exist', { extensions: { code: 'NOT_FOUND' } })
else return toMachineObject(r)
})