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

Better compilation error message #150

Open
imranismail opened this issue Aug 18, 2018 · 3 comments
Open

Better compilation error message #150

imranismail opened this issue Aug 18, 2018 · 3 comments

Comments

@imranismail
Copy link

Currently the error message doesn't include the path to the template that it's compiling.

It's just showing the View's function body. Is there a way to identify which template it is failing at?

== Compilation error in file lib/fave/views/reservation_view.ex ==
** (Slime.TemplateSyntaxError) got ArgumentError with message "argument error" while retrieving Exception.message/1 for %Slime.TemplateSyntaxError{column: 0, line: "  .ui.container", line_number: 9, message: "{:no_match, <<14>>}", source: "INPUT"}
    lib/slime/parser.ex:14: Slime.Parser.parse/1
    lib/slime/renderer.ex:17: Slime.Renderer.precompile/1
    lib/phoenix_slime/engine.ex:9: PhoenixSlime.Engine.compile/2
    (phoenix) lib/phoenix/template.ex:378: Phoenix.Template.compile/2
    (phoenix) lib/phoenix/template.ex:186: anonymous fn/3 in Phoenix.Template."MACRO-__before_compile__"/2
    (elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
    (phoenix) expanding macro: Phoenix.Template.__before_compile__/1
    lib/fave/views/reservation_view.ex:1: Fave.ReservationView (module)
    (elixir) lib/kernel/parallel_compiler.ex:206: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
@Rakoth
Copy link
Member

Rakoth commented Aug 18, 2018

Thanks for the report.
It would be great to pass template file name along with error message, do you want to look into this?

@Rakoth
Copy link
Member

Rakoth commented Aug 21, 2018

@imranismail You can try installing slime from master branch, this argument error is now fixed and indentation errors have better message

@szsoppa
Copy link

szsoppa commented Sep 28, 2020

Hi! I'm using the latest master version of Slime, and it seems like there is still a problem with the proper error compilation message.

Just in case, I have the proper config set:

config :slime, :keep_lines, true

Libs versions:

  • elixir 1.11.0-rc.0
  • phoenix 1.5.5
  • phoenix_slime 0.13.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants