
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?
TypeScript
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);
    }
};
TL;DR
 Issue: Error is demonstrating as not a function in the code.
Solution: The 'error' function should be accessed through the 'context' property. Modify the code to use `context.error()` instead of just 'error'.
In the logs, it does say to use context.log() or context.error() but how would I get the context property?
Recommended threads
- AI feature by functions?I'm creating a website where, in short, users can index certain genealogical content. In connection with the development of AI, I was thinking about introducing... 
- Unknown usage from one of my databaseI need support help. For more than 2 weeks, i didn't make any requests to my database, but I have noticed huge amount of reads and writes requests: Around 8000... 
- AppwriteException: Missing required para...I'm using node-appwrite sdk to retrive the documents. Example my code on pic, was define collectionId but error is still. Why? 
