Skip to content

Commit

Permalink
starlark::Error <-> buck2_error conversion
Browse files Browse the repository at this point in the history
Summary:
Add implementations for buck2_error<->starlark. Code will be used in the next diff.

Note that there's `from_starlark` and `from_starlark_impl` because we need a way for caller to choose to not print stacktrace and/or be categorized (Though the categorized should eventually be removed once we categorize everything properly, but we will do this for now)

Reviewed By: JakobDegen

Differential Revision: D63487582

fbshipit-source-id: cdfa3ea9b8cd42a1d1428ff8420be8a96ee83a76
  • Loading branch information
Will-MingLun-Li authored and facebook-github-bot committed Oct 22, 2024
1 parent 1f5f1b3 commit b658deb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions starlark_syntax/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ impl Error {
self.0.span()
}

pub fn call_stack(&self) -> &CallStack {
self.0.call_stack()
}

/// Set the span, unless it's already been set.
pub fn set_span(&mut self, span: Span, codemap: &CodeMap) {
self.0.set_span(span, codemap);
Expand Down

0 comments on commit b658deb

Please sign in to comment.