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

IRC log for #mojo, 2017-04-17

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

All times shown according to UTC.

Time Nick Message
00:47 Lee joined #mojo
01:15 maschine joined #mojo
02:18 noganex_ joined #mojo
04:04 dboehmer joined #mojo
06:41 Vandal joined #mojo
08:34 inokenty-w joined #mojo
08:44 rshadow joined #mojo
08:58 tdnh joined #mojo
11:13 wouter joined #mojo
11:13 wouter hi -- I'm trying to implement a parser for content-security-policy reports
11:14 wouter those are sent as a POST request with just JSON data in the body
11:14 wouter I can't figure out how to get at that body from mojolicious
11:14 wouter there's $c->param() for url-encoded parameters, but JSON is not url-encoded
11:14 wouter any hints?
11:14 purl NONE
11:15 wouter eh?
11:18 kaare joined #mojo
11:21 go|dfish wouter: it's a (rude) bot.
11:21 go|dfish wouter: isn't it $c->req->json you're after? http://mojolicious.org/perldoc/Mojolicious/Guides/Tutorial#JSON
11:22 wouter go|dfish: oh, right
11:22 wouter missed that, but thanks
11:40 tchaves joined #mojo
12:34 bwf joined #mojo
12:35 perlpilot joined #mojo
13:10 gizmomathboy joined #mojo
13:25 tchaves joined #mojo
13:28 Pyriticc joined #mojo
13:29 Pyritic joined #mojo
13:40 tchaves joined #mojo
13:43 gryphon joined #mojo
13:55 jacobydave joined #mojo
14:18 maschine joined #mojo
14:40 disputin joined #mojo
15:08 Mike_PM joined #mojo
15:10 asarch joined #mojo
15:32 sh14 joined #mojo
15:40 PopeF0 joined #mojo
16:24 PryMar56 joined #mojo
16:24 stephan48 joined #mojo
16:39 stryx` joined #mojo
17:02 dod joined #mojo
17:13 sri interesting to see so much negative news about openstack recently
17:14 sri so many leaving the project
17:14 sri is the code quality really that bad?
17:14 sri "cringeworthy" is what i hear the most :o
17:21 stryx` joined #mojo
17:25 disputin joined #mojo
18:04 Grinnz https://metacpan.org/release/TURNSTEP/DBD-Pg-3.6.0
18:04 genio lots o changes
18:05 sri hope nothing breaks :o
18:06 genio looks like lots of bug fixes \o/
18:06 sri Mojo::Pg tests pass at least
18:06 sri which reminds me
18:06 sri jberger: what happened to your patch?
18:07 jberger I never could figure out where/what causes those notices to be printed
18:07 jberger like, I think it would have to be $SIG{__WARN__} with a regexp for /^NOTICE:/
18:08 jberger and I don't think that's worth doing personally
18:08 sri i doubt that
18:09 jberger I would have thought so too
18:09 jberger but DBI suggests it (three references to trapping $SIG{__WARN__}, eg here: https://metacpan.org/pod/DBI#PrintWarn)
18:10 jberger but then as I tried to write it, only that handler worked, not even those boolean options did
18:12 ribasushi jberger: what notices?
18:12 purl notices is a type of verb. noticed is a type of verb. is noticing is a type of verb. despises is a type of verb. removes is a type of verb. removed is a type of verb. is removing is a type of verb. tastes like is a type of verb.
18:12 jberger from postgres
18:12 jberger let me look it up, I had a simple way of provoking one
18:13 jberger perl -Ilib -MMojo::Pg -E 'Mojo::Pg->new("postgres://test:test@/test")->db->query(q[SELECT to_tsquery(?)], "")'
18:14 ribasushi and nopaste the text?
18:14 jberger NOTICE:  text-search query doesn't contain lexemes: ""
18:14 ribasushi ah that stuff... sec
18:15 ribasushi $dbh->do('SET client_min_messages=WARNING'); <--- this should do it
18:15 jberger right, that works from the db side
18:15 jberger is there nothing the client side can do to divert those?
18:15 jberger for example, if I wanted to log those to the app logger
18:16 jberger (or discard them)
18:16 jberger there is a hook for error messages, which Mojo::Pg already uses
18:16 jberger but it doesn't get triggered for NOTICE it seems
18:17 ribasushi it's a warning, so the error handler won't see it
18:17 ribasushi there's a Warn facility in DBI itself, might need to see if there is a $dbh->{Callback} for it
18:18 ribasushi the way you originally phrased it was you want to silence the warning, though it seems you actually want to trap/process it
18:18 jberger its been a few days, so I'm only 90% sure of this, but as I recall, I tried those boolean options and they didn't actually suppress the warnings, and there was no callback
18:19 ribasushi nod, it might be that this is a different beast than what I was silencing with the above
18:20 * ribasushi will install the mojo stuff later will check the example out
18:21 dod joined #mojo
18:21 jberger I doubt it would be much different than just using raw DBI
18:27 genio o.O looking through DBI.xs and DBI/PurePerl.pm is ... fun
18:28 Grinnz DBI is a ... unique beast
18:29 genio seeing   use or require 5.008; and then     # hack for 5.6 ...       checking to see if a method is supported with  eval { require Foo; Foo::blah(); 1; } rather than Foo->can('blah');
18:29 Grinnz heh
18:31 genio but, Warn, it seems is simply a boolean attribute.
19:03 litwol joined #mojo
19:13 Pyritic joined #mojo
19:32 rshadow joined #mojo
19:54 Pyritic joined #mojo
20:03 stryx` joined #mojo
20:12 dantti_laptop joined #mojo
20:38 marcus joined #mojo
20:38 stryx` joined #mojo
20:38 batman joined #mojo
20:38 sri jberger: so, what is wrong with this? perl -Ilib -MMojo::Pg -E 'my $pg = Mojo::Pg->new("postgres://tester:testing@/test"); my $db = $pg->db; local $db->dbh->{Warn} = 0; $db->query(q[SELECT to_tsquery(?)], "")'
20:42 jberger BAH, the problem of using local data
20:42 jberger I was putting ->{Warn} = 0 on $sth rather than $dbh
20:42 jberger and of course it doesn't complain, how could it?
20:48 jberger and local works for synchronous requests (say if I put it here: https://github.com/kraih/mojo-pg/blob/master/lib/Mojo/Pg/Database.pm#L86)
20:48 jberger but not for async requests of course
20:49 jberger could it just be set right away: https://github.com/kraih/mojo-pg/blob/master/lib/Mojo/Pg.pm#L78
20:49 jberger (without local of course)
21:21 dikim joined #mojo
22:33 sri sure
23:43 stryx` joined #mojo

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