- changed status to duplicate
Marshmallow Firedac Adapter loses Exception Stack Trace when reporting firedac exceptions
When reporting exceptions in the Spring.Persistence.Adapters.FireDAC unit the following nomenclature is followed:
raise EFireDACAdapterException.CreateFmt(EXCEPTION_CANNOT_OPEN_QUERY, [E.Message]);
This is a bug in our opinion because now we cannot get to pertinent information in the underlying Firedac exception that we need in order to make decisions about what to do.
This loses all the important data in the underlying exception except for the message. So for instance if I want to see the full stack trace, or the Vendor Database specific error code, and so on. It is likely lost.
Maybe a suggestion for a better way to capture and reissue exceptions is the following:
Exception.RaiseOuterException(EFireDACAdapterException.CreateFmt(EXCEPTION_CANNOT_OPEN_QUERY, [E.Message]));
This will raise your product specific exception as before but will set the exception chain to the wrapped exception making all data from the initial exception available in your exception.
Thanks for your consideration of this.
Comments (1)
-
repo owner - Log in to comment
Duplicate of
#100.