 		do {
 			try exec(deleteSQL(self.table(), idName: idname), params: [String(describing: idval)])
 		} catch {
-			throw StORMError.error(error.localizedDescription)
+			self.error = StORMError.error(error.localizedDescription)
+			throw error
 		}
 	}
 

		do {
			try select(whereclause: "\(idname) = $1", params: [String(describing: id)], orderby: [])
		} catch {
			throw StORMError.error(error.localizedDescription)
		}
	}


		do {
			try select(whereclause: "\(idname) = $1", params: [String(describing: idval)], orderby: [])
		} catch {
			throw error
		}
	}


	public func find(_ data: [(String, Any)]) throws {
		let (idname, _) = firstAsKey()

		var paramsString = [String]()
		var set = [String]()
		for i in 0..<data.count {
			paramsString.append(data[i].1 as! String)
			set.append("\(data[i].0) = $\(i+1)")
		}

		do {
			try select(whereclause: set.joined(separator: " AND "), params: paramsString, orderby: [idname])
		} catch {
			print("Error detacted: \(error)")
		}

	}
}
