[hyena] Make some error msgs more useful



commit 073f16afe3156af924c5576a47fe23731c0d5353
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Tue Mar 9 13:23:45 2010 -0800

    Make some error msgs more useful

 .../Hyena.Data.Sqlite/HyenaSqliteCommand.cs        |    2 +-
 .../Hyena.Data.Sqlite/SqliteUtils.cs               |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/Hyena.Data.Sqlite/Hyena.Data.Sqlite/HyenaSqliteCommand.cs b/src/Hyena.Data.Sqlite/Hyena.Data.Sqlite/HyenaSqliteCommand.cs
index b80ecbd..a550d0a 100644
--- a/src/Hyena.Data.Sqlite/Hyena.Data.Sqlite/HyenaSqliteCommand.cs
+++ b/src/Hyena.Data.Sqlite/Hyena.Data.Sqlite/HyenaSqliteCommand.cs
@@ -189,7 +189,7 @@ namespace Hyena.Data.Sqlite
 
             if (param_values.Length != parameter_count) {
                 throw new ArgumentException (String.Format (
-                    "Command has {0} parameters, but {1} values given.", parameter_count, param_values.Length
+                    "Command {2} has {0} parameters, but {1} values given.", parameter_count, param_values.Length, command
                 ));
             }
 
diff --git a/src/Hyena.Data.Sqlite/Hyena.Data.Sqlite/SqliteUtils.cs b/src/Hyena.Data.Sqlite/Hyena.Data.Sqlite/SqliteUtils.cs
index c9083c2..5095a0d 100644
--- a/src/Hyena.Data.Sqlite/Hyena.Data.Sqlite/SqliteUtils.cs
+++ b/src/Hyena.Data.Sqlite/Hyena.Data.Sqlite/SqliteUtils.cs
@@ -156,7 +156,11 @@ namespace Hyena.Data.Sqlite
 
         public override object Invoke (object[] args)
         {
-            return funcs[args[0] as string] (args[1], args[2]);
+            Func<object, object, object> func;
+            if (!funcs.TryGetValue (args[0] as string, out func))
+                throw new ArgumentException (args[0] as string, "HYENA_BINARY_FUNCTION name (arg 0)");
+
+            return func (args[1], args[2]);
         }
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]