<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://community.activestate.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>ActiveState Community Site - How to capture error messages... - Comments</title>
 <link>http://community.activestate.com/forum-topic/how-capture-error-messages</link>
 <description>Comments for &quot;How to capture error messages...&quot;</description>
 <language>en</language>
<item>
 <title>How to capture error messages...</title>
 <link>http://community.activestate.com/forum-topic/how-capture-error-messages</link>
 <description>&lt;p&gt;Hi I am a new bie and have been coding a relatively easy structured programming method.&lt;/p&gt;
&lt;p&gt;I have a snippet of my program which will:&lt;/p&gt;
&lt;pre class=&quot;geshifilter&quot;&gt;#-----Running LDAPMODIFY Against The Ldif File Created-----#
sub RunUpdate
{
	print &quot;--Updating Directory server. Please wait for a moment....\n\n&quot;;	
	my $resultLdapSearch = `ldapmodify -h $ldap_server -D &quot;cn=Directory Manager&quot; -w $dir_mgr_pwd -f $ldap_modify_file`;
	#print &quot;resultLdapSearch: $resultLdapSearch\n&quot;;
}&lt;/pre&gt;&lt;p&gt;When running the program I get a output error due to the ldapmodify command is trying to update and existing field, as shown below:&lt;/p&gt;
&lt;pre class=&quot;geshifilter&quot;&gt;bash-2.05# perl 4-run_update_attributes.pl

*****************************************************************************
Step #4 - The Script WILL NOW Update The Users &quot;Company&quot; and &quot;Co&quot; Attributes
*****************************************************************************

Do you want to continue [y]:
--Updating Directory server. Please wait for a moment....

ldap_modify_s: Type or value exists

***********************************************************************
See Result:
-----------
Log Output file (verified): 01152008.log
***********************************************************************&lt;/pre&gt;&lt;p&gt;As you notice, the error &quot;ldap_modify_s: Type or value exists&quot; appears from the &quot;ldapmodify&quot; that I executed. I need to know how do I capture this value and will write some codes to handle this error.&lt;/p&gt;
&lt;p&gt;Please advice.&lt;/p&gt;
</description>
 <comments>http://community.activestate.com/forum-topic/how-capture-error-messages#comments</comments>
 <category domain="http://community.activestate.com/forums/perl-discussion-0">Perl discussion</category>
 <category domain="http://community.activestate.com/os/solaris-10-x86">Solaris 10 ( X86 )</category>
 <pubDate>Tue, 15 Jan 2008 11:11:26 +0000</pubDate>
 <dc:creator>fabster01</dc:creator>
 <guid isPermaLink="false">1829 at http://community.activestate.com</guid>
</item>
</channel>
</rss>
