Use string instead of exception to avoid serialisation errors.