Fix EZP-23495: Catch correct exception