[NEXUS-7768] Log before throwing as Nexus does not log exceptions thrown by realms