The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2017-12-24

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:53 mohawk CandyAngel, what OS?
00:57 CandyAngel mohawk: Arch Linux
00:57 purl Arch Linux is not as cool as demi linux.
00:58 CandyAngel They now ship it with an empty /etc/hosts
01:07 mohawk that seems... misguided
01:35 Grinnz thats a new one
04:05 karjala_ joined #mojo
04:38 marty joined #mojo
04:55 jberger https://twitter.com/joelaberger/status/944793127809961984
04:56 mohawk w00t
04:57 mohawk (heart emoji)
07:16 Vandal joined #mojo
10:38 dotan_convos joined #mojo
10:54 obi_wan joined #mojo
11:50 itaipu joined #mojo
12:37 sh14 joined #mojo
13:49 karjala_ joined #mojo
13:57 ladnaV joined #mojo
14:07 karjala_ joined #mojo
14:16 sri jberger++
15:03 geospeck joined #mojo
16:28 mtths joined #mojo
16:32 karjala_ joined #mojo
16:46 ChmEarl joined #mojo
17:07 jamesaxl joined #mojo
18:30 mib_d10whv joined #mojo
18:51 itaipu joined #mojo
20:09 jberger sri: so I've been having a little fun in my free time
20:09 jberger I've reworked the websocket_multiplex.js to put a middle layer between the Multiplex object and the object emulating the websocket
20:09 jberger https://github.com/jberger/Mojolicious-Plugin-Multiplex/blob/subscriber/share/websocket_multiplex.js
20:10 jberger in that way any consumer can close their "websocket" and it won't accidentally unsubscribe everyone
20:11 jberger the user-facing api is unchanged, indeed I've removed the "subscribe" method from the object they get, so it is even closer to the WebSocket interface
20:11 jberger I did add new custom events for reconnecting and reconnected
20:37 mohawk noice
21:13 mib_sli1b8 joined #mojo
21:13 mib_sli1b8 Hi Guys
21:13 mib_sli1b8 Is there a way to "hook" into the mojo exception handler (i.e. that shown/thrown on the Morbo exception page, but instead in hypnotoad) so that I can capture that data including line, lines_after, lines_before and possibly the full context data structures, so I can have it emailed to me.
21:15 mohawk mib_sli1b8, why not do that in the logger?
21:16 mib_sli1b8 Not sure that captures the same info
21:17 mohawk i'd suggest giving that a proper try first
21:17 mib_sli1b8 the errors I'm trying to find are spurious and are generually in underlying code, not the mojo app,
21:17 mohawk what you're describing is most like aggravated logging :-)
21:18 mohawk there's a mojo log level of "error", which sounds like an exception
21:18 mohawk and in recent debugging i've seen Mojo::Exceptions with very (very) detailed info including stack trace, surrounding code, ...
21:19 mohawk perhaps someone more knowledgeable about mojo's logging can weigh in :-)
21:19 mib_sli1b8 So I assume the Morbo exception page uses Mojo::Exception, so I think that's what I need to hook into
21:20 mohawk le sigh
21:20 mohawk sure, why not hack an error page instead of going with the idiom
21:21 preaction or you could replace the exception.html.ep
21:21 mib_sli1b8 Well, I have already done that for app errors, but these errors could be as I said not my errors
21:21 preaction but the errors get logged by mojolicious, because mojolicious traps errors in controller actions
21:22 mib_sli1b8 Well it may not be just controller actions, could be anywhere and currently that is captured via morbo error page which contains the full context
21:22 preaction except it _is_ a controller action because morbo is rendering an error page
21:23 preaction you could also use Devel::Confess
21:23 mib_sli1b8 ok, well, I mean not directly
21:23 preaction that doesn't matter to exception handling
21:23 mohawk exceptions are really a multi-level return
21:23 mohawk that's any number of levels
21:24 mohawk could be from within your own code, someone else's, ...
21:25 mohawk in mojo-land, (preaction please correct me here), i believe there's two big things that happen on an exception: logging, and showing an error page
21:25 mib_sli1b8 During an exception, the morbo page at some point has access to all the data it displays, so I would to hook into that so I can monitor that specific data - i.e. just watch in context
21:25 mohawk that means if you want to do something different from the default, you have two places to hook into: the logging, or the error page
21:25 mohawk if you want to change what a consumer sees, change the error page
21:25 mohawk if you want to change anything else, especially what's to be seen by admins, change the logging
21:26 mohawk you're an admin, so to me that says you should aim for the second one
21:26 preaction you keep saying you want to do a certain thing and that it will get you what you want, but we keep telling you there's other ways to get what you want.
21:26 mohawk i fear that mib_sli1b8 has made a decision on the exact way to do things, and now knows better than anyone else what the best approach is
21:26 mib_sli1b8 preaction: yes, but I dont understand why I should find another method, when one clearly already exists
21:27 preaction what one already exists?
21:27 mohawk "why SHOULDN'T i made furniture with this pair of scissors? i mean, it will clearly work!"
21:27 preaction mohawk: that isn't necessary
21:27 mohawk preaction, you're right, sorry
21:28 preaction well, how about, that isn't helpful
21:28 preaction anyway
21:28 preaction there's also this doc: http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Rendering-exception-and-not_found-pages
21:28 preaction anything that involves monkey-patching is a bad idea and likely to have unforeseen consequences, so that's not a solution that already exists
21:30 mohawk my intention was to use irony to show the problem with a line of thinking, but it could easily be read as sarcasm, which is bad and unhelpful
21:31 CandyAngel That's not fair, I'm british!
21:32 mohawk CandyAngel, life isn't fair
21:32 mohawk in other news, merry xmas
21:32 mohawk in other other news, what are you referring to? :-)
21:32 mib_sli1b8 I was hoping to find a solution in which I could hook or have callback that would return the full context of an exception, I think its logical and far to assume this approach is reasonable based on the fact tha morbo already does this
21:33 CandyAngel mohawk: Already know that. 3 hours into christmas eve and I injured myself :|
21:34 mib_sli1b8 So, basically, I think you guys are suggesting I achieve this via logging
21:34 mohawk oh dear! nothing too serious i hope?
21:34 preaction mib_sli1b8: i also linked to the doc explaining how to do things with a before_render hook
21:34 CandyAngel Maybe bruised rib/pulled muscle or something like that
21:34 mohawk mib_sli1b8, that's still a hook, it's just in (probably) the right place
21:34 preaction but yes, i suggest achieving this with logging
21:35 mohawk CandyAngel, ow
21:35 mib_sli1b8 So if I wanted to investigate what morbo does, where should I look?
21:36 preaction ... i just linked to the doc explaining that
21:36 mib_sli1b8 OK, just checking :)
21:37 mib_sli1b8 thanks for the info, have a nice xmas
21:37 preaction "just checking" what?
21:38 mohawk "just checking, SIR!"
21:39 mib_sli1b8 Yes SIR
21:39 mohawk good luck with the coding
21:39 mohawk and merry xmas!
21:54 CandyAngel mohawk: Pretty much. Luckily, server coding doesn't involve much moving around :P
21:55 mohawk #NerdThugLife
22:33 mohawk_pts joined #mojo
23:26 sri looks like this proposal is getting some support https://github.com/kraih/mojo/issues/1175
23:43 mohawk_pts i even commented on it

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary