core: avoid findbug issues for encoding and bare exceptions catch

Change-Id: I6f87ad979954807feb68c5fa971da246b01beaef
Signed-off-by: Yaniv Bronhaim <ybronhei@redhat.com>