
I have a simple function that gets the transcriptId
param but for some reason I get TypeError: error is not a function
? I thought this is how your supposed to use error
and log
?
import { Client, Databases } from 'node-appwrite';
import { throwIfMissing } from './utils.js';
export default async ({ req, res, log, error }) => {
try {
if (req.method === 'GET') {
const transcriptId = req.bodyJson.transcriptId;
if (!transcriptId) {
error("Missing transcriptId parameter");
return res.json({ error: "Missing transcriptId" }, 400);
}
} else {
return res.json({ error: "Method not allowed" }, 405);
}
} catch (e) {
error("Function error:", e);
return res.json({ error: "Internal server error: " + e.message }, 500);
}
};

In the logs, it does say to use context.log()
or context.error()
but how would I get the context
property?
Recommended threads
- Is Quick Start for function creation wor...
I am trying to create a Node.js function using the Quick Start feature. It fails and tells me that it could not locate the package.json file. Isn't Quick Start ...
- Connecting server functions to GitHub re...
The project I am working in has recently moved organizations on Appwrite. The same is true for the repo on GitHub, which as moved from a private user to a organ...
- Missing C++ libstdc library in Python fu...
I have a function running Python 3.12 which suddenly started dumping errors (as of today; it worked yesterday). I hadn't changed any code so I found this odd, b...
