Change exception thrown by db method

Change exception in db method, because previous one had necessary
parameter which is undefined in db function. The undefined parameter
in the previous exception caused a new exception to be thrown.

Change-Id: I52ccb813d33d7c382f9447252fc5a1017ff625ac
Closes-Bug: #1364394
Merge "Change exception thrown by db method"