Catch and log exceptions in Contributions\Query

Change-Id: I6c386bdd83daef6661a66b79c5b04d4dda77b330
(cherry picked from commit 582a41f21d9be4a9ed5a48426c6b16657ee737ec)