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

Idea: Text-only, Markdown-formatted errors #87

Closed
rstacruz opened this issue Jan 10, 2013 · 4 comments
Closed

Idea: Text-only, Markdown-formatted errors #87

rstacruz opened this issue Jan 10, 2013 · 4 comments

Comments

@rstacruz
Copy link
Collaborator

Hi,

just thought of an interesting feature. it'd be nice to have Markdown-formatted errors like this:

# NameError at /master/documents
  undefined local variable or method `title' for #<Document:0x0000010ab430d8>

## Code
   app/models/document.rb, line 10:

       8   mount_uploader x
       9   def to_s
    > 10     title || filename
      11   end
      12
      13   def filename

## Backtrace

 * __Document#to_s__ (app/models/document.rb, line 10)
 * __DocumentController#show__ (app/controllers/document_controller.rb, line 50)

How?

  • This can be the output when the page is accessed via curl/wget/ajax.
  • This can be a comment at the start of the HTML, so I can peek at it when doing "view source".
  • This can be copied to the clipboard via some button in the interface.

Why?

  • Easy pasting of error info into Github issues, Trello, Pivotal Tracker.
  • Readable output for text-only terminals (eg, curl or wget)

I'd be happy to work on this.

@rstacruz
Copy link
Collaborator Author

Related: #79

@haileys
Copy link
Collaborator

haileys commented Jan 10, 2013

Seems like an interesting idea. You could probably get away with just adding another template and rendering with that to implement this.

@rstacruz
Copy link
Collaborator Author

Text-only error pages are now served in non-graphical browsers (curl, wget, etc--via checking the HTTP Accept header), AJAX requests, and in the HTML page as a comment at the end.

@haileys
Copy link
Collaborator

haileys commented Feb 7, 2013

This has landed in master, closing.

@haileys haileys closed this as completed Feb 7, 2013
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

2 participants