Skip to content

Commit

Permalink
fix(schema): Jinja - show source line in error message (#6885)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Jul 14, 2023
1 parent 9538e56 commit ec3ce22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/cubejs-backend-native/src/python/template/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ impl<'a> NeonMiniJinjaContext for FunctionContext<'a> {
content += &format!("{:>4} | {}\r\n", idx + 1, line);
}

content += &format!("{:>4} > {}\r\n", idx + 1, lines[idx].1);

if let Some(_span) = err.range() {
// TODO(ovr): improve
content += &format!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ exports[`Jinja render template_error.jinja: template_error.jinja 1`] = `
7 | 7
8 | {%- for country in countries %}
9 | 9
10 > {%- unexpected_block_name %}
i ^^^^^^^^^^^^^^^^^^^^^^^^ syntax error
11 | 11
12 | 12
Expand Down

0 comments on commit ec3ce22

Please sign in to comment.