On Thu, Feb 21, 2008 at 8:36 AM, John Siracusa <[EMAIL PROTECTED]> wrote:
> Just set the "overflow" property of the column to "warn" or "truncate" > to override teh default "fatal" mode: > > > http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/MakeMethods/Generic.pm#overflow Well that's a different matter. I had tried that a while back and found that the result was the same, which was what caused me to go back to the default overflow behavior. Now that you refer me to that spot in the code, I see that it calls croak() even when overflow is set to 'warn'. Maybe that's supposed to be a carp(). In any case, an option to non-fatally refuse to set the value might be nice. Seems like handle_error() would do the trick. But like I said, there must be some reason why handle_error() is not being used there that I don't understand. Anyway, the "overflow => 'warn'" option will at least keep it from croak'ing, now that I see what appears to be a typo in Generic.pm (line 123). Index: lib/Rose/DB/Object/MakeMethods/Generic.pm =================================================================== --- lib/Rose/DB/Object/MakeMethods/Generic.pm (revision 1597) +++ lib/Rose/DB/Object/MakeMethods/Generic.pm (working copy) @@ -120,7 +120,7 @@ no warnings 'uninitialized'; if(length(\$value) > $length) { - Carp::croak ref(\$self), ": WARNING: Value for $qname() is too long. ", + Carp::carp ref(\$self), ": WARNING: Value for $qname() is too long. ", "Maximum length is $length [EMAIL PROTECTED] $length == 1 ? '' : 's' ]}. ", "Value is ", length(\$value), " characters: \$value"; } Thanks, John ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object