#perl - Fri 20 Apr 2007 between 09:22 and 09:44



siliperltoot
anno_you'll have to bless it
actionCPAN upload: Sys-Statistics-Linux-0.09_15 by BLOONIX
CPANupload: Sys-Statistics-Linux-0.09_15 by BLOONIX
[miles]afternoon #perl
guys, I have an ldap lookup, that may or may not fail
when it fails, I get an error in the logs... how can I supress errors in a section of code please?
anno_what logs?
[miles]$result = $ldap->search(
anno_: hi anno, it's a modification to spamassassins ldap prefs lookup
actionanno_ shrugs
anno_shrugs
[miles]nothing like in php using @
?
anno_i don't know the internals of spamassassin
scrottieclose STDERR.
[miles]it's just that one command I need to suppres
it's gonna be called repeatadly and very frequently, so it needs to be fast
scrottie: and to open it again? open STDERR ?
scrottiedepends. there are different kinds of errors. syntax errors, raised errors, fatals, uncaught dies, uncaught warns....
Prof_Vincemaybe the ldap constructor has something for suppressing that
scrottieuh, no. once closed, it stays closed. there's no /dev/stdout you can open.
that was kind of an obnoxious answer. sorry.
[miles]Apr 20 12:57:44 spamwall spamd[4627]: dc=bankingspain.com,ou=domains,dc=entorno,dc=es: No such object at /usr/local/share/perl/5.8.7/Mail/SpamAssassin/Conf/LDAP.pm line 198
scrottiebut I really can't make a useful suggestion without knowing more about what kind of error it is.
[miles]that gets put in mail.log
anno_ugh
[miles]only cos in this, it loads domain prefs only, there is no user
scrottieeval { } around the LDAP call and then inspect $@ if you like. it'll contain the text of the error if there wa sone.
[miles]which is fine, as it's allready loaded the domain prefs..
scrottieas Prof_Vince said, there may also be an option to turn off the raised errors.
[miles]Prof_Vince: hello
Prof_Vince: any ideas please
thank you scrottie
anno_a failed ldap search doesn't die. the return value has its ->code set, iirc
scrottie/Mail/SpamAssassin/Conf/LDAP.pm line 198
yeah. M::SA. stupid thing.
change that line of code. it's probably a 'warn' or something.
[miles]scrottie: nod
scrottie: it is working correctly...
anno_warn can be caught via $SIG{ __WARN__}
[miles]scrottie: just have to supress it in the user prefs

Page: 1 8 15 22 29 36 43 50 57 64 71 78 85 

IrcArchive