The OpenTelemetry specification discusses exceptions.
Opentelemetry-cpp does not provide a recordException method. In C++, it is recommended to manually create a span event to record the exception. In MATLAB, we can provide a recordException method that takes an MException object input and generate a span event that records the details of the exception.