00:00:26  * TheThingjoined
00:02:08  * UniOnquit (Remote host closed the connection)
00:02:28  * nicholaswyoung_quit (Ping timeout: 265 seconds)
00:05:05  * TheAceOfHeartsquit (Quit: Leaving.)
00:10:07  * hmsimhaquit (Ping timeout: 252 seconds)
00:12:19  * crzrcn1joined
00:13:08  * crzrcnquit (Ping timeout: 246 seconds)
00:20:42  * felipefdljoined
00:21:25  * TheAceOfHeartsjoined
00:30:18  * Foxandxssquit (Quit: Textual IRC Client: www.textualapp.com)
00:39:26  * corbanbquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
01:01:31  * stagasjoined
01:05:31  * hmsimhajoined
01:13:55  * hmsimhaquit (Ping timeout: 252 seconds)
01:24:11  * stagasquit (Ping timeout: 246 seconds)
01:31:43  * TheAceOfHeartsquit (Quit: Leaving.)
01:33:12  * eh_eff_joined
01:35:22  * eh_effquit (Ping timeout: 240 seconds)
01:38:18  * eh_eff_quit (Ping timeout: 245 seconds)
01:45:51  * nicholaswyoung_joined
01:51:04  * nicholaswyoung_quit (Ping timeout: 245 seconds)
01:53:40  * crzrcn1quit (Quit: Leaving.)
02:02:55  * eh_eff_joined
02:07:03  * hmsimhajoined
02:12:56  * TheAceOfHeartsjoined
02:14:26  * TheThingquit (Remote host closed the connection)
03:19:10  * sojquit (Ping timeout: 250 seconds)
03:28:58  * jonglebe_quit (Remote host closed the connection)
03:29:26  * jongleberryjoined
03:34:10  * jongleberryquit (Ping timeout: 265 seconds)
03:34:41  * nicholaswyoung_joined
03:40:00  * nicholaswyoung_quit (Ping timeout: 252 seconds)
04:20:53  * TheAceOfHeartsquit (Quit: Leaving.)
04:23:15  * eh_eff_quit (Quit: WeeChat 1.1)
04:30:34  * calebboydjoined
04:30:44  * calebboydpart
04:32:01  * calebboydjoined
04:51:33  * felipefdlquit (Quit: (null))
05:03:22  * calebboydpart
05:23:33  * nicholaswyoung_joined
05:28:54  * nicholaswyoung_quit (Ping timeout: 246 seconds)
07:07:32  * nicholaswyoung_joined
07:12:45  * jongleberryjoined
07:41:05  * felipefdljoined
07:41:31  * TheAceOfHeartsjoined
07:45:20  * felipefdlquit (Ping timeout: 246 seconds)
07:45:25  * nicholaswyoung_quit (Quit: Lingo: www.lingoirc.com)
07:51:54  * amodoquit (Ping timeout: 245 seconds)
07:57:00  * amodojoined
08:02:26  * TheAceOfHeartsquit (Quit: Leaving.)
08:03:22  * stagasjoined
08:14:40  * joshonthewebjoined
08:32:17  * basicdaysquit (Ping timeout: 246 seconds)
09:30:09  * felipefdljoined
09:34:35  * felipefdlquit (Ping timeout: 246 seconds)
09:45:17  * gabeioquit (Ping timeout: 256 seconds)
09:51:38  * gabeiojoined
10:03:05  * joshonthewebquit (Quit: Computer has gone to sleep.)
10:10:47  * stagasquit (Ping timeout: 256 seconds)
10:24:20  * Foxandxssjoined
11:18:54  * felipefdljoined
11:23:28  * felipefdlquit (Ping timeout: 252 seconds)
11:27:25  * dobsonquit (Read error: Connection reset by peer)
11:34:31  * dobsonjoined
12:06:01  * hemanth_joined
12:11:46  * felipefdljoined
13:02:40  * hemanth_quit (Read error: Connection reset by peer)
13:03:18  * hemanth_joined
13:51:26  * ramitosjoined
15:14:15  * EvanFreemanjoined
15:51:04  * stagasjoined
15:58:51  * hemanth_quit (Quit: This computer has gone to sleep)
16:14:45  * basicdaysjoined
16:20:41  * jdriscolljoined
16:26:05  <jdriscoll>Is calling reject() when yielding to a Promise not supported in Koa? It hangs in my tests where resolve() works fine.
16:28:28  * katana_quit (Ping timeout: 265 seconds)
16:28:51  * katana_joined
16:30:36  <TheThing__>reject() literally throws an error jdriscoll
16:35:53  * UniOnjoined
16:38:34  <jdriscoll>Ok. So Koa doesn't handle that error? So if I'm fetching a URL using http.get in a Promise and returning the accumulated body how would I handle a non-200 response? I can't self.throw from where I get the actual response afaict. Wrap the response and body and return both to the middleware?
16:42:15  <TheThing__>koa should handle the error and return the non-200 response you specified in the .reject
16:42:24  <TheThing__>oh wait, I misread what you said :b
16:42:33  <TheThing__>I thought you meant ".throw()" not ".reject()"
16:42:34  <TheThing__>my bad
16:47:40  * basicdaysquit (Quit: I'm out)
16:51:42  * EvanFreemanquit (Ping timeout: 244 seconds)
16:56:57  <jdriscoll>No, thank you for your help. I'm probably missing something simple but if I call reject with an error the server returns a 500 response where I'd like to be able to handle the error and return a more approprate response. Obviously this is a stupid example but I'm trying to wrap my head around the best way to perform non-trivial async tasks from within the context of a middleware (db queries, etc.). All the examples I've found
16:56:58  <jdriscoll> online have been trivial synchronous operations (this.body = "hello world"). Here's the code I'm playing with: https://gist.github.com/jdriscoll/af914bd6085c5af68032
16:58:50  <Foxandxss>jdriscoll: don't quote me on this, because I really never tried
16:58:56  <Foxandxss>but I think you need to do a try catch
16:59:07  <Foxandxss>with the yield
17:05:39  <jdriscoll>Foxandxss: Ok thanks. That's does get me past the 500 but my middleware still doesn't know what the response was, just that it failed.
17:33:14  <jdriscoll>Thanks all. Combining try/catch with sticking the body onto the response object, returning it and handling http errors in the middleware appears to work ok. https://gist.github.com/jdriscoll/af914bd6085c5af68032
17:34:33  * jongleberryquit (Remote host closed the connection)
17:34:59  * jongleberryjoined
17:35:15  <TheThing__>thanks for that jdriscoll
17:35:22  <TheThing__>That's gonna be useful to remember in the future
17:39:14  * jongleberryquit (Ping timeout: 244 seconds)
17:50:03  * Foxandxssquit (Quit: Textual IRC Client: www.textualapp.com)
17:51:40  * crzrcnjoined
18:02:10  * jongleberryjoined
18:19:26  * UniOnquit (Remote host closed the connection)
18:27:25  * jdriscollquit (Quit: Textual IRC Client: www.textualapp.com)
18:27:44  * jdriscolljoined
18:29:27  * jdriscollpart
18:30:10  * jdriscolljoined
18:46:57  * stagasquit (Quit: Bye)
18:48:50  * TheAceOfHeartsjoined
18:58:27  * HairAndBeardGuyquit (Ping timeout: 246 seconds)
19:05:19  * eh_effjoined
19:14:13  * HairAndBeardGuyjoined
20:09:16  * rickharrisonquit (Ping timeout: 252 seconds)
20:13:40  * rickharrisonjoined
20:15:57  * joshonthewebjoined
20:47:35  * eh_effquit (Ping timeout: 246 seconds)
21:07:33  * basicdaysjoined
21:56:02  * eh_effjoined
22:08:43  * nicholaswyoungjoined
22:11:44  * Foxandxssjoined
22:16:42  * ramitosquit (Remote host closed the connection)
22:18:47  * Foxandxssquit (Read error: Connection reset by peer)
22:18:47  * Foxandxs_joined
22:19:00  * Foxandxs_changed nick to Foxandxss
22:19:00  * Foxandxssquit (Changing host)
22:19:00  * Foxandxssjoined
22:20:37  * jdriscollquit (Quit: Textual IRC Client: www.textualapp.com)
22:29:45  * TheAceOfHeartsquit (Quit: Leaving.)
22:41:51  * felipefdlquit (Quit: (null))
22:43:58  * Limixjoined
22:47:27  * felipefdljoined
22:50:21  * felipefdlquit (Client Quit)
22:50:36  * felipefdljoined
22:55:15  * TheAceOfHeartsjoined
23:05:40  * mekwallquit (Ping timeout: 264 seconds)
23:07:45  * mekwalljoined
23:44:21  * felipefdlquit (Quit: My Mac has gone to sleep. ZZZzzz…)
23:59:52  * felipefdljoined