Fork me on GitHub

@gary: Yes. I know Java interop. I am just having trouble modelling my domain in more of a Clojurish way.


@yusup well you've come to the right place. 😄 are you able to elaborate


I am writing a app. In my app , I go from A (an url of a certain website) ,B( crawl it with phantomjs or just with clj-http if phantomjs crawling fails in given time) ,C(Index crawled page in ElasticSearch, and extract URLs and save them in a DB. ).... Thing is that if certain step fails I want to have throw exception which includes Information about previous steps.


I've already implemented what I described above , but it just felt awkward and not lispy.


My first thought on that would be to have a map with information in it that gets passed from step to step and then queried for information if there’s an error somewhere along the way.


@akiva: what if there are many nested function calls?


Think about it like this: what you’re doing is essentially keeping a log of the process. So you can have each function add its action and result to the data.


But, keep in mind, nesting functions isn’t really idiomatic for FP.


Functions should operate independently of each other and be ultimately unaware. They just take input and produce output. Chaining rather than nesting.


Thanks. I will think about it. I have to refactor my code now.


Sure, sure. Keep asking questions and there is a #C053PTJE6 channel if you want people to look at what you’re doing.