Skip to content

Nodejs Abort error #876

Open
Open
@bhrigushr

Description

After upgrading NodeJs SDK(readmeio) from 5.1.0 to 6.1.0
I am seeing too many Abort errors & unable to catch them which causes the server to crash.

Error ->

AbortError: The user aborted a request.
    at abort (/app/node_modules/node-fetch/lib/index.js:1448:16)
    at AbortSignal.abortAndFinalize (/app/node_modules/node-fetch/lib/index.js:1463:4)
    at AbortSignal.dispatchEvent (/app/node_modules/event-target-shim/dist/event-target-shim.js:818:35)
    at abortSignal (/app/node_modules/abort-controller/dist/abort-controller.js:52:12)
    at AbortController.abort (/app/node_modules/abort-controller/dist/abort-controller.js:91:9)
    at Timeout.<anonymous> (/app/node_modules/timeout-signal/index.js:15:14)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
{'type':'aborted','message':'The user aborted a request.'}

My Code looks like this

async readmeInterceptor(req, res, data: ReadmeData): Promise<void> {
    try {
      await readme.log(
        README_CONFIG.apiKey,
        req,
        res,
        {
          apiKey: data.apiKey || data.email, // apiKey cannot be empty
          label: data.label,
          email: data.email,
        },
        {
          fireAndForget: false,
          // optional, enable in development mode
          development: !IS_PROD,
          // denyList: [], // array of any sensitive fields returned by API
        },
      );
    } catch (error) {
      this.logger.error(error, { teamId: data.teamId });
    }
    return Promise.resolve();
  }

Let me know how to handle this AbortError

Metadata

Assignees

No one assigned

    Labels

    nodeIssues related to our Node SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions