generic setting try except