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 sce #159

Open
rikhuijzer opened this issue Jul 12, 2021 · 0 comments
Open

Add sce #159

rikhuijzer opened this issue Jul 12, 2021 · 0 comments

Comments

@rikhuijzer
Copy link
Collaborator

rikhuijzer commented Jul 12, 2021

Show code and error

  function get_error(expr::String)
      try
          sco(expr)
      catch e
          exc, bt = last(Base.catch_stack())
          stacktrace = sprint(Base.showerror, exc, bt)::String
          stacktrace = Books.clean_stacktrace(stacktrace)
          lines = split(stacktrace, '\n')
          lines = lines[1:end-8]
          join(lines, '\n')
      end
  end

  function show_error(expr::String)
      out = output_block(JDS.get_error(expr))
      code = code_block(expr)
      """
      $code
      $out
      """
  end

Also here, we need a process and post. The latter is useful in shortening output.

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

No branches or pull requests

1 participant