Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listDirectoryFiles 随机报错 #21

Open
GiantappMan opened this issue Feb 23, 2021 · 1 comment
Open

listDirectoryFiles 随机报错 #21

GiantappMan opened this issue Feb 23, 2021 · 1 comment

Comments

@GiantappMan
Copy link

随机报错,不是每次都报错,但是总能遇见,用户端非常影响体验

image

云函数代码

      let wallpaperPath = `xxx`
      console.log("wallpaperPath:", wallpaperPath)
      try {
        let tmp = await storage.listDirectoryFiles(wallpaperPath);
        console.log("tmp1:", tmp)
        ctx.data.result = tmp;
      } catch (error) {
        console.log("listDirectoryFiles error:", error)
        throw error
      }

image


云函数日志

返回结果:

{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"ECONNRESET: socket hang up\n    at createHangUpError (_http_client.js:323:15)\n    at TLSSocket.socketCloseListener (_http_client.js:364:25)\n    at TLSSocket.emit (events.js:194:15)\n    at _handle.close (net.js:597:12)\n    at TCP.done (_tls_wrap.js:388:7)","statusCode":430}

日志:

START RequestId:c5c3b807-7585-11eb-9459-5254006d699d

2021-02-23T03:18:17.413Z c5c3b807-7585-11eb-9459-5254006d699d wallpaperPath: livewallpaper/upload/wallpapers/73add6b99af64135972c4f607d243030/79550af2603473c8069131395b66ea9c

2021-02-23T03:18:17.416Z c5c3b807-7585-11eb-9459-5254006d699d listDirectoryFiles error: { ECONNRESET: socket hang up

    at createHangUpError (_http_client.js:323:15)

    at TLSSocket.socketCloseListener (_http_client.js:364:25)

    at TLSSocket.emit (events.js:194:15)

    at _handle.close (net.js:597:12)

    at TCP.done (_tls_wrap.js:388:7)

  message: 'socket hang up',

  code: 'ECONNRESET',

  error: { message: 'socket hang up', code: 'ECONNRESET' } } 

ERROR RequestId:c5c3b807-7585-11eb-9459-5254006d699d Result:{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"ECONNRESET: socket hang up\n    at createHangUpError (_http_client.js:323:15)\n    at TLSSocket.socketCloseListener (_http_client.js:364:25)\n    at TLSSocket.emit (events.js:194:15)\n    at _handle.close (net.js:597:12)\n    at TCP.done (_tls_wrap.js:388:7)","statusCode":430} 

END RequestId:c5c3b807-7585-11eb-9459-5254006d699d

Report RequestId:c5c3b807-7585-11eb-9459-5254006d699d Duration:6ms Memory:128MB MemUsage:45.765625MB
@GiantappMan
Copy link
Author

一般出现这种问题,第二次执行就对了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant