wrapMaybe

Converts the exception to a wrapped exception if wrap is true.

Return

The wrapped exception or the original exception.

Parameters

wrap

A boolean indicating whether to wrap the exception or not.