Business intelligence made simple
Improved error message for could not determine data type of parameter - #406
Andrew Kane1d0939a51739
diff --git a/lib/blazer/adapters/sql_adapter.rb b/lib/blazer/adapters/sql_adapter.rbindex caee7739..e048a211 100644--- a/lib/blazer/adapters/sql_adapter.rb+++ b/lib/blazer/adapters/sql_adapter.rb@@ -35,6 +35,9 @@ module Blazererror = e.message.sub(/.+ERROR: /, "")error = Blazer::TIMEOUT_MESSAGE if Blazer::TIMEOUT_ERRORS.any? { |e| error.include?(e) }error = Blazer::VARIABLE_MESSAGE if error.include?("syntax error at or near \"$") || error.include?("Incorrect syntax near '@") || error.include?("your MySQL server version for the right syntax to use near '?")+ if error.include?("could not determine data type of parameter")+ error += " - try adding casting to variables and make sure none are inside a string literal"+ endreconnect if error.include?("PG::ConnectionBad")end