[LOGTOOL-78] Use better logic to determine the correct exception constructor to use. Note this changes the behaviour that used the first possible constructor found. Now the last usable constructor will be used.