This is mainly to support using SharpHound over C2. In some situations, SharpHound may throw some exception which the agent does not handle properly, leading to a generic error to be emitted (e.g., [-] Invoke_3 on EntryPoint Failed). The addition of this try/catch wrapper will cause a more specific error message to be returned to the user in the event that the collector fails, allowing them to debug the issue.
This is mainly to support using SharpHound over C2. In some situations, SharpHound may throw some exception which the agent does not handle properly, leading to a generic error to be emitted (e.g.,
[-] Invoke_3 on EntryPoint Failed
). The addition of this try/catch wrapper will cause a more specific error message to be returned to the user in the event that the collector fails, allowing them to debug the issue.