Skip to content

Instantly share code, notes, and snippets.

@anquegi
Last active October 3, 2019 11:23
Show Gist options
  • Save anquegi/132e8979604f5d563e47ec9fe33b04db to your computer and use it in GitHub Desktop.
Save anquegi/132e8979604f5d563e47ec9fe33b04db to your computer and use it in GitHub Desktop.
When using ruby better errors gem and emacs restclient package, When the Api has an error the raw html of better errors is the response so in order to filter the filename and line you can use this function
(defun better-errors-file ()
(interactive)
(let ((root (libxml-parse-html-region (point-min) (point-max))))
(message "file: %s at line: %s"
(dom-attr (dom-by-class root "application") 'data-full-filename)
(dom-attr (dom-by-class root "application") 'data-line))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment