Skip to content

Commit

Permalink
improve incorrect number of parameter error checking #18
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Getto committed Jun 11, 2013
1 parent d55d533 commit d0a3932
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pynuodb/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import protocol
from datatype import TypeObjectFromNuodb
from exception import Error, NotSupportedError, EndOfStream, OperationalError
from exception import Error, NotSupportedError, EndOfStream, OperationalError, ProgrammingError

class Cursor(object):

Expand Down Expand Up @@ -88,7 +88,7 @@ def execute(self, operation, parameters=None):
"""
self._check_closed()
self._reset()
if not parameters:
if parameters is None:
self._execute(operation)

else:
Expand Down Expand Up @@ -172,7 +172,7 @@ def _executeprepared(self, operation, parameters):
p_count = self.session.getInt()

if p_count != len(parameters):
raise OperationalError
raise ProgrammingError("Incorrect number of parameters specified, expected %d, got %d" % (p_count, len(parameters)))

# Use handle to query
self.session.putMessageId(protocol.EXECUTEPREPAREDSTATEMENT)
Expand Down

0 comments on commit d0a3932

Please sign in to comment.