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

Runtime: attempt to clean up error output #852

Merged
merged 18 commits into from
Jan 4, 2025
Merged

Conversation

josephjclark
Copy link
Collaborator

@josephjclark josephjclark commented Jan 4, 2025

This PR makes a number of tweaks to error output to be more readable

  • Include a stack trace (but only show VM and adaptor frames)
  • Log error details if they exist (as JS, not JSON, for nicer output)
  • Don't log stuff we don't care about, like the internal error type and source

I want to get really really good testing on this.

Examples

Examples use the CLI but the worker receives exactly the same logs

Adaptor error coming out of HTTP:
image

Reference error in job code:

image

Error inside the adaptor if config is undefined

image

Nice 500 error coming out of ODK

image

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

@josephjclark josephjclark changed the base branch from main to sourcemapping January 4, 2025 12:31
@josephjclark josephjclark merged commit aaa7e7b into sourcemapping Jan 4, 2025
9 checks passed
@josephjclark josephjclark deleted the cleaner-errors branch January 4, 2025 15:39
josephjclark added a commit that referenced this pull request Jan 13, 2025
* compiler: generate a source map if a job name is passed

* runtime: add a position mapping function

* runtime: map error position

* runtime: update test

* comment

* runtime: properly map positions and stack traces in errors

* compiler: more tests

* cli: refactor to build sourcemaps up properly

* lexicon: updated typings

* runtime: nicely log errors with position and line of code

* runtime: tidy up

* runtime: rewrite sourcemap tests and improve typings

* runtime: fix tests

* runtime: ensure a sourcemap is set when a workflow is generated from a string expression

* tests: add tests for error types

Not sure how useful this is tbh

* runtime: typing

* engine: adjust to new compiler API

* changesets

* runtime: update test

* format

* runtime: refine error output

* tests: added error logging tests

* Sourcemapping adaptor errors (#851)

* runtime: refine error output

* tests: added error logging tests

* compiler: append positional information to top level operations

* compiler: write the operations map to the souce map

* lexicon: add typings for extended source map

* lexicon: tweak sourcemap types

* package lock

* runtime: updat error handling to handle adaptor errors with source mapping

* runtime: better handling of nested adaptor errors

probably

* runtime: update tests

* cli: types

* tidy

* runtime: better handling of nested errors

* Runtime: attempt to clean up error output (#852)

* compiler: append positional information to top level operations

* compiler: write the operations map to the souce map

* lexicon: add typings for extended source map

* lexicon: tweak sourcemap types

* package lock

* runtime: updat error handling to handle adaptor errors with source mapping

* runtime: better handling of nested adaptor errors

probably

* runtime: update tests

* cli: types

* tidy

* runtime: better handling of nested errors

* runtime: improvements to reporting of errors

* changeset

* runtime: improve error details

* runtime: better frame detection for adaptor errors

* runtime: fix tests

* tests: update output logs

* logger: ensure timestamp is added to print logs, so that the worker can handle them properly

* version: [email protected] [email protected]

* tmp: worker to rc1 version

* fix openfnx build

Make sure dist is properly cleaned each time

* runtime: simplify adaptorerror constructor

* tests: fix adaptor versions

* cli: skip flay test

* tests: skip more flaky docs tests

* worker: version to 1.9.0

* cli: update changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant