<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>t/007_error_log.t</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -73,6 +73,7 @@ has 'scoreboard'  =&gt; (
 );
 
 has 'prefix' =&gt; ( is =&gt; 'rw', isa =&gt; 'Str', default =&gt; '' );
+has 'error_length' =&gt; ( is =&gt; 'rw', isa =&gt; 'Int', default =&gt; 255 );
 
 sub debug {
     my $self = shift;
@@ -136,6 +137,7 @@ sub insert {
         eval {
             $self-&gt;_try_insert($job,$dbh);
         };
+        $self-&gt;debug(&quot;insert failed: $@&quot;) if $@;
 
         next unless $job-&gt;jobid;
 </diff>
      <filename>lib/TheSchwartz/Moosified.pm</filename>
    </modified>
    <modified>
      <diff>@@ -75,13 +75,17 @@ sub as_hashref {
 
 sub add_failure {
     my $job = shift;
-    my ($msg) = @_;
+    my $msg = shift;
+    $msg = '' unless defined $msg;
     
     my $table_error = $job-&gt;handle-&gt;client-&gt;prefix . 'error';
+    if (my $len = $job-&gt;handle-&gt;client-&gt;error_length) {
+        $msg = substr($msg,0,$len);
+    }
     my $sql = qq~INSERT INTO $table_error (error_time, jobid, message, funcid) VALUES (?, ?, ?, ?)~;
     my $dbh = $job-&gt;dbh;
     my $sth = $dbh-&gt;prepare($sql);
-    $sth-&gt;execute(time(), $job-&gt;jobid, $msg || '', $job-&gt;funcid);
+    $sth-&gt;execute(time(), $job-&gt;jobid, $msg, $job-&gt;funcid);
 
     # and let's lazily clean some errors while we're here.
     my $maxage = $TheSchwartz::Moosified::T_ERRORS_MAX_AGE || (86400*7);</diff>
      <filename>lib/TheSchwartz/Moosified/Job.pm</filename>
    </modified>
    <modified>
      <diff>@@ -42,7 +42,7 @@ CREATE TABLE PREFIX_note (
 CREATE TABLE PREFIX_error (
         error_time      INTEGER NOT NULL,
         jobid           BIGINT NOT NULL,
-        message         VARCHAR(255) NOT NULL,
+        message         TEXT NOT NULL,
         funcid          INT NOT NULL DEFAULT 0
 );
 </diff>
      <filename>schema/Pg.sql</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b8c98170a248d63d253026f634db33718a8da204</id>
    </parent>
  </parents>
  <author>
    <name>Stash</name>
    <email>jeremy.stashewsky@socialtext.com</email>
  </author>
  <url>http://github.com/socialtext/theschwartz-moosified/commit/e441ded80f26cf4c104ac483bb7f4804890388e6</url>
  <id>e441ded80f26cf4c104ac483bb7f4804890388e6</id>
  <committed-date>2009-05-20T12:26:09-07:00</committed-date>
  <authored-date>2009-05-20T12:26:09-07:00</authored-date>
  <message>Add error_length option for error message logging</message>
  <tree>e59c241d78418539bd2960ed64cbfdd3e28ccf15</tree>
  <committer>
    <name>Stash</name>
    <email>jeremy.stashewsky@socialtext.com</email>
  </committer>
</commit>
