<FromGitter>
<bararchy> How do I get the actual error of `Errno` type exception? (like `EWOULDBLOCK` etc..) it seems calling `.class` just returns `Errno`
absolutejam has joined #crystal-lang
early has joined #crystal-lang
<FromGitter>
<elorest> @watzon that's the solution I ended up going with. I'm still a bit concerned that it works on MacOS though. Should they both overflow at the same time?
<FromGitter>
<stronny> would definitely by much more nice to be able to rescue separately
<FromGitter>
<bararchy> @stronny it is, but it's an Int32, which indeed eq to the constant, but, there is no way to resolve `Errno::ENOINT` from `e.value` unless you create an enum
<FromGitter>
<watzon> No kidding. It would make copying regex from Ruby libs a lot easier
<FromGitter>
<watzon> @stronny agreed, needs some refactoring
<FromGitter>
<stronny> I don'y understand the problem. Yes, you can't resolve a constant by its value, but do you really need to?
<FromGitter>
<stronny> Instead of an Errno enum why not subclass `Errno::ENOENT < Errno` and then `rescue x : Errno::ENOENT`?
<FromGitter>
<j8r> yep they could be each individual classes
<FromGitter>
<j8r> instead of constants
<FromGitter>
<bararchy> because then I'll need to do 50~ different rescues XD
<FromGitter>
<bararchy> I just want to get the string of the actual "class" of error
<FromGitter>
<bararchy> I don't have anything else to do with it
<FromGitter>
<stronny> maybe at least suger it up a bit to be able to do `if error.enoent?` ?
absolutejam has quit [Ping timeout: 268 seconds]
<FromGitter>
<asterite> I think Errno#errno should be an enum, then you could do `if error.errno.enoent?`
<FromGitter>
<didactic-drunk> @stronny See #1124 referenced from #445. @asterite already said he may add C# like exception filters which seems like it would fix most of the rescue issues.
<FromGitter>
<c-cube> for subprocesses, there seems to be a pool of threads doing the IOs, right? ⏎ I'm running a bunch of fibers, each of which does `Process.run`, but it doesn't kill my load
<FromGitter>
<Blacksmoke16> it uses fibers internally
<FromGitter>
<Blacksmoke16> and `#run` waits for it to finish
<FromGitter>
<c-cube> yeah but I mean, it doesn't try to start 100 processes in //
<FromGitter>
<Blacksmoke16> right, they would go sequentially no?
<FromGitter>
<c-cube> I run each in a separate fiber
<FromGitter>
<Blacksmoke16> they already run in fibers tho?
<FromGitter>
<Blacksmoke16> my understanding is your spawning a fiber with a process.run, which spawns another fiber and blocks until the process is done
<FromGitter>
<Blacksmoke16> so essentially only doing 1 process at a time
<FromGitter>
<c-cube> but I'm doing that in a lot of different fibers
<FromGitter>
<c-cube> something like `Dir.glob("*") { |file| spawn { … } }` where each fiber runs a process on the file, basically
<sorcus>
Hmmmm... Maybe i should logout and login again, because no errors if i run binary as root.
gangstacat has quit [Ping timeout: 246 seconds]
alex`` has quit [Ping timeout: 276 seconds]
gangstacat has joined #crystal-lang
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
Human_G33k has quit [Remote host closed the connection]