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

Add eprint function #611

Merged
merged 6 commits into from
Feb 19, 2024
Merged

Add eprint function #611

merged 6 commits into from
Feb 19, 2024

Conversation

hulto
Copy link
Collaborator

@hulto hulto commented Feb 18, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • Adds eprint function to allow users to emit errors manually.
  • Move eprint to a native function
  • Support eprint in golem interactive.

Which issue(s) this PR fixes:

Fixes #610

@hulto hulto linked an issue Feb 18, 2024 that may be closed by this pull request
@hulto hulto changed the title Basic impl Add eprint function Feb 18, 2024
Copy link

codecov bot commented Feb 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0c49df7) 71.24% compared to head (a60e256) 71.35%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #611      +/-   ##
==========================================
+ Coverage   71.24%   71.35%   +0.10%     
==========================================
  Files         168      169       +1     
  Lines       11224    11265      +41     
==========================================
+ Hits         7997     8038      +41     
  Misses       3023     3023              
  Partials      204      204              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hulto hulto marked this pull request as ready for review February 19, 2024 02:33
#[allow(unused_variables)]
fn eprint(starlark_eval: &mut Evaluator<'v, '_>, message: String) -> anyhow::Result<NoneType> {
let env = crate::runtime::Environment::from_extra(starlark_eval.extra)?;
eprint_impl::eprint(env, message)?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love that we pass env here, greatly demonstrates the separation between eprint (starlark) and eprint_impl (native rust)

@hulto
Copy link
Collaborator Author

hulto commented Feb 19, 2024

Ignoring golem interactive for now tracking here:
#625

@hulto hulto merged commit f03960d into main Feb 19, 2024
6 checks passed
@hulto hulto deleted the 610-allow-users-to-emit-errors branch February 19, 2024 04:56
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

Successfully merging this pull request may close these issues.

Allow users to emit errors.
2 participants