Skip to content

Conversation

jonpither
Copy link
Contributor

Fixes #493

@jonpither
Copy link
Contributor Author

Perhaps at some stage:

if (not (cider-connected-p)) (message "No active nREPL connection.")

Could be pulled out into a macro as it's used frequently.

CHANGELOG.md Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to me you forgot something here :-)

@bbatsov
Copy link
Member

bbatsov commented Mar 3, 2014

I don't think a macro is required. A simple function like this should do:

(defun cider-ensure-connected ()
   (unless (cider-connected-p)
     (error "No active nREPL connection")))

error will halt the execution of subsequent forms.

@jonpither
Copy link
Contributor Author

The changelog I'll fix :-)

I'll use the fn you suggest and use it in the other locations where cider-connected-p is checked.

@jonpither
Copy link
Contributor Author

Changes made. I could edit to commit msg to read "and introducing cider-ensure-connected" if you want.

@bbatsov
Copy link
Member

bbatsov commented Mar 3, 2014

Yep, that'd be nice. Alternatively you can have this split into two commits, as they are unrelated.

@jonpither
Copy link
Contributor Author

I changed the commit msg :-)

bbatsov added a commit that referenced this pull request Mar 3, 2014
[Fix #493] Rotate nREPL connection handles no nREPL connection.
@bbatsov bbatsov merged commit 41b4608 into clojure-emacs:master Mar 3, 2014
@bbatsov
Copy link
Member

bbatsov commented Mar 3, 2014

Thanks!

@jonpither jonpither deleted the rotate-no-connection branch March 3, 2014 19:15
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

Successfully merging this pull request may close these issues.

Rotate nrepl connection when no nrepl connections breaks cider
2 participants