The Python stack trace for exceptions in scheduled events (in particular in class functions called from such event) is quite cryptic with limited information and lacks line numbers.

Can this be improved?

Example below. Good luck trying to find location of this error!

QuantConnect.Scheduling.ScheduledEventException: In Scheduled Event 'SPY: MonthEnd: SPY: 15 min before MarketClose', ---> System.Exception: ValueError : cannot reindex from a duplicate axis ---> Python.Runtime.PythonException: ValueError : cannot reindex from a duplicate axis
at Python.Runtime.PyObject.Invoke (Python.Runtime.PyObject[] args) [0x00035] in <0f995c28c5b446ad8835419f76b319a3>:0
at QuantConnect.Scheduling.ScheduleManager+<>c__DisplayClass15_0. b__0 (System.String name, System.DateTime time) [0x00007] in :0
at QuantConnect.Scheduling.ScheduledEvent.OnEventFired (System.DateTime triggerTime) [0x00036] in :0
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---

Author