Skip to content

Log client errors to log file, submit on next CLI execution #1659

@janpio

Description

@janpio

Quoting @schickling

If there’s an unexpected error in the client, the client should create a “error trace file” that will then be picked up by the CLI to prompt the user to report the detailed error.


(Input from @albertoperdomo via prisma/prisma-client-js#661)

What we think we would need to implement:

  1. dump errors during runtime into log files if NODE_ENV != "production" or version includes dev (because CLI probably only exists there)
  2. (optional) automatic restart after a panic, could be dangerous if an infinite loop is hit
  3. truncate the file if based on filesize, i.e. 1MB or time, i.e. 1 day
  4. have the timestamp of the last occurrence
  5. debounce or throttle to avoid spamming the file system
  6. (optional, too complex?) de-duping occurrences of the same error

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions