This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-28
Channels
- # announcements (1)
- # babashka (28)
- # beginners (228)
- # cider (9)
- # clara (6)
- # clojure (66)
- # clojure-uk (13)
- # clojuredesign-podcast (5)
- # clojurescript (9)
- # core-typed (1)
- # cursive (1)
- # duct (2)
- # emacs (8)
- # fulcro (18)
- # graalvm (11)
- # hyperfiddle (1)
- # malli (2)
- # off-topic (33)
- # re-frame (9)
- # reagent (3)
- # reitit (15)
- # shadow-cljs (6)
- # tools-deps (1)
Recently started coding after a bit of a hiatus. Previously when working with files or directories on the file system I’ve passed around http://java.io.File objects. Things work fine for files but I run a function in the REPL that returns a http://java.io.File object that corresponds to a directory I get an exception in the REPL.
( "/tmp")
#object[.File 0x62d0be87 "/tmp"]ERROR: Unhandled REPL handler exception processing message {:op slurp, :url file:/private/tmp/, :session 8e4e013a-57b2-472d-8fb7-bbcaf27fb7ba, :id 39}
.IOException: Is a directory
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.FileDispatcherImpl.read(FileDispatcherImpl.java:46)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:159)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103)
at java.nio.file.Files.read(Files.java:3105)
at java.nio.file.Files.readAllBytes(Files.java:3158)
at cider.nrepl.middleware.slurp$slurp_url_to_content_PLUS_body.invokeStatic(slurp.clj:90)
at cider.nrepl.middleware.slurp$slurp_url_to_content_PLUS_body.invoke(slurp.clj:82)
at cider.nrepl.middleware.slurp$handle_slurp.invokeStatic(slurp.clj:116)
at cider.nrepl.middleware.slurp$handle_slurp.invoke(slurp.clj:108)
Using cider 0.23.0
and cider/cider-nrepl "0.22.4"
https://docs.cider.mx/cider/repl/configuration.html see the section on images in the repl. It works by just fetching urls and it’s a bad default I think
Yeah, probably this should be disabled, but then I doubt we’ll ever fix it that way. The problem is long-standing and no one tried to tackle it so far. I might just delete this functionality and consider it a failed experiment.
This issue has occurred for me before as well. A coworker had it happening and I had to help diagnose it as a cider issue they were seeing. Was an NPE on this content type thing. And he wasn’t trying to look at an image or anything like that.
@dpsutton Thank you so much for this. I was wondering why I was getting weird things in my repl when handling files.
